Good day!
I am struggling with a problem concerning my POS application integration with the VIVA softPOS application.
The documentation on developer.viva.com give us:
my class in B4X:
"viva_status" is reciever with the content:
It's OK, the application starts.
My manifest file should contain:
I am trying to "put" it to the manifest editor as:
The effect in the softPOS is message "Note: I have not found an activity" displayed.
Can someone help me, where the error I occur?
Krzysztof
I am struggling with a problem concerning my POS application integration with the VIVA softPOS application.
The documentation on developer.viva.com give us:
code:
Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
"vivapayclient://pay/v1"
+ "?appId=com.example.myapp"
+ "&action=sale"
+ "&clientTransactionId=1234567801234"
+ "&amount=1200"
+ "&tipAmount=200"
+ "&show_receipt=true"
+ "&show_transaction_result=true"
+ "&show_rating=true"
+ "&ISV_amount=100"
+ "&ISV_clientId=kf7fpz4c4gkc6ch03u4415o8acipq9xdefzuto4b6by94.apps.vivapayments.com"
+ "&ISV_clientSecret=SY5Nt33019xdyagX85Ct6DQwpTiZhG"
+ "&ISV_sourceCode=Default"
+ "&ISV_currencyCode=978"
+ "&ISV_customerTrns=ItemDescription"
+ "&ISV_clientTransactionId=12345678901234567890123456789012"
+ "&ISV_merchantId=1234567890"
+ "&ISV_merchantSourceCode=9090"
+ "&paymentMethod=CardPresent"
+ "&callback=mycallbackscheme://result"));
payIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(payIntent);
my class in B4X:
my class:
Sub Class_Globals
Private app As String
Private VivaConfig As Map
Dim MyMerchantID As String
Dim kwota As Int
Dim cel As Int
Dim komentarz As String
Dim payIntent As Intent
Private Const FLAG_ACTIVITY_NEW_TASK As Int = 0x10000000 '268435456
Private Const FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS As Int = 0x00800000 '8388608
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
End Sub
Public Sub MakePayment
Dim sb As StringBuilder
sb.Initialize
sb.Append("vivapayclient://pay/v1")
sb.Append("?merchantKey="&MyMerchantID)
sb.Append("&appId=pl.numen.vivatest")
sb.Append("&action=mmSale")
sb.Append("&clientTransactionId=1234567801234")
sb.Append("&amount="&kwota.As(String))
sb.Append("&show_receipt=True")
sb.Append("&show_transaction_result=True")
sb.Append("&show_rating=True")
sb.Append("¤cyCode=985")
sb.Append("&clientTransactionId=12345678901234567890123456789012")
sb.Append("&customerTrns=123456qwwert")
sb.Append("&callback=vtest://res")
Dim uri As String = sb.ToString
payIntent.Initialize(payIntent.ACTION_VIEW,uri)
payIntent.Flags = Bit.Or(FLAG_ACTIVITY_NEW_TASK, FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
StartActivity(payIntent)
End Sub
Public Sub result
End Sub
"viva_status" is reciever with the content:
reciever:
Sub Process_Globals
End Sub
'Called when an intent is received.
'Do not assume that anything else, including the starter service, has run before this method.
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
Dim i As Intent = StartingIntent
Dim res As String = i.GetData
Log("extras: "&i.ExtrasToString)
Log("data: "&res)
End Sub
It's OK, the application starts.
My manifest file should contain:
needed manifest content:
<activity
android:name="com.example.URLResponseActivity"
android:label="Payment Result">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="com.example.URLResponseActivity"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<!-- Provide your own scheme here and reference it when you send a message -->
<data
android:scheme="mycallbackscheme"
android:host="result"/>
</intent-filter>
</activity>
I am trying to "put" it to the manifest editor as:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/> )
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddReceiverText(viva_status,
android:name="pl.numen.vivatest.viva_status"
android:label="Payment Result"
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="pl.numen.vivatest.viva_status"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="vtest"
android:host="res"/>
</intent-filter>
)
The effect in the softPOS is message "Note: I have not found an activity" displayed.
Can someone help me, where the error I occur?
Krzysztof
Last edited: