how to start a payment from a browser on an android mobile device to the vivawallet app (app to app payment) on the same device?
To trigger an app-to-app payment directly from a web browser on an Android device to the Viva.com Terminal app installed on the same device, you can leverage Android’s handling of custom URL schemes.
When a user clicks a link using Viva's custom scheme, the Android OS intercepts the intent and redirects the user from the mobile browser directly into the local terminal application to handle the payment.
The implementation details and URI format are structured as follows:
1. The Deep Link URI Structure
To launch a sale from a browser link, you need to construct a URI string using Viva’s scheme (vivapayclient://). Because it is running from a web browser, formatting this as an Android intent:// token provides the most reliable fallback if the application is missing from the device.
The base structure requires specific query parameters to execute a sale and safely return the user back to your browser application upon completion.
HTML
<a href="intent://pay/v1?appId=your.website.com&action=sale&amount=1250¤cy=978&callback=https://yourwebsite.com/payment-callback#Intent;scheme=vivapayclient;package=com.vivawallet.spoc.payapp;end">
Pay €12.50 via Viva Wallet App
</a>
2. Parameter Breakdown
3. Handling the Payment Response
Once the transaction is processed (whether approved, failed, or canceled), the Viva.com Terminal app invokes your specified callback URL. It appends critical payment parameters directly onto your return URL query string.
Your web server or frontend JavaScript needs to parse these parameters to verify the transaction outcome:
status: Indicates the result (success or fail).
message: A human-readable text explanation of the status.
transactionId: The unique tracking reference generated by Viva for successful payments.
⚠️ Security Warning: Never rely solely on front-end client redirects or query parameters to mark an order as paid in your backend database. Always pair this app-to-app flow with a Viva Wallet Webhook (Transaction Payment Created) sent from Viva’s servers directly to your backend server to securely finalize the order processing.
Reacties
Een reactie posten