- Created by user-8f2bd, last modified on Oct 04, 2018
App2App payment support for Pay With Zeta (PWZ) eases the process of getting customer’s authorization on e-commerce mobile apps by overlaying a Swipe to Pay option, thereby avoiding the 2-step authentication process which consumes time in events of high frequency of payments.
Merchant partners can now seamlessly get customer’s consent for an intended payment directly within the mobile app ecosystem where the complexity of payment handling and user authentication are safely handled by the App2App payment support, allowing the merchants to only focus on accepting online payment from Zeta users.
PayWithZeta can be integrated using the checkout flow. The details of the flow are described below.
The details of the typical checkout flow of the App2App payment support is described below:
- User adds items to the cart on the merchant e-commerce app and goes to the checkout page.
User clicks on PayWithZeta option, shown on merchant page, to complete the payment.
- The merchant app shares the payment details (as per the Request app2app authorization API contract mentioned below) with the Zeta app installed on the same device.
- The Zeta app gets the customer’s authorization by overlaying a Swipe to Pay option.
When using Swipe to Pay,
- If the customer swipes to authorize the payment, Zeta app will respond back to the merchant to the callback URL shared by the merchant app in step 3.
- If the customer denies the authorization, Zeta app will return the Error payload mentioned below.
Once the merchant app gets the user’s consent (when user authorizes payment in step 5(a)), merchant will get the payment charged by making a server to server API call (ref contract Charge a transaction with Auth API).
Mobile OS Integration
The App2App feature is available for Android and iOS platforms. The details of each method is described below.
Before You Begin
Take care of following before you integrate Android and iOS apps:
- For Android integration, ensure that the Zeta app version is 184.108.40.206 or greater, as this feature does not work on older versions (App version can be found in About Us screen).
- For iOS integration, ensure that the Zeta app version is greater than 2.11.0, as this feature doesn't work on lesser versions.
Request and response for the Android version of app takes place through Intents (a messaging object used to request an action). Upon a request, intents start an activity for Swipe to Pay authorization and will emit a success/failure state of the authorization as activity result.
Please follow below steps for integration:
When payment authorization is needed, create the following intent:
- Prepare the request payload. Convert it to JSON and pass it in the intent.
Add the request payload to the intent, with the key as “data”.
Check if the intent can be handled.
The intent cannot be found in the older versions of the app.
Start the activity to see if the intent can be handled, as specified above.
On a valid request, swipe to pay screen is launched. On invalid request, the error callback intent is sent as result.
If authorization is successful, activity result is Activity.RESULT_OK, along with the success response payload(JSON) as an intent extra with key “data”.
Please follow below steps for integration:
Zeta app should be invoked for user’s authorization by invoking a Zeta app URL of the following format:
The above Zeta app URL is invoked by the openUrl method.
Before calling the openUrl method, you must ensure if the above URL can be handled by the user’s device with the help of canOpenUrl method.
If the canOpenUrl method returns NO, you must not attempt to invoke the URL and must instead use some other fallback mechanism to complete the payment flow.
<json string>which is an encoded string version of the request payload using the below code:
You must define a custom URL scheme for the callBackUrl, which must be present in the request payload.
For a merchant app named Starbucks, the custom URL scheme is
starbucks://and the callBackUrl sent in the request payload is
You must handle callBackUrl invocation by the Zeta app through the App Delegate. Success or failure authorization will be depicted using query parameter in the callBackUrl as shown below:
<json string>,which is a string encoded version of the response payload, to a proper NSDictionary object using the below code:
Download and install Zeta Staging app through TestFlight to test out these features. We will send out invitations to apple ids of iOS developers, for accessing the TestFlight build.
Intents are messaging objects used to request an action, through which requests and responses take place for the Android app. Upon a request, intents will start an activity for swipe to pay authorization and will emit a success/failure state of the authorization as activity result.
If immediate refunds are not honoured, a CRON (running every one hour) will reverse the transaction. If in rare cases, the refund cannot be honoured, then the refund will get dropped after n configurable number of attempts (currently 30) and the customer will be refunded in 3 days.
For Android: Zeta app version must be 220.127.116.11 or greater.
For iOS: Zeta app app version must be greater than 2.11.0
The transaction will not be terminated. User will be redirected to web app for completing the transaction.
Timeout period is 30 seconds.
The user is directly prompted to swipe2pay and then prompt for PIN if needed, without the need to go to Zeta app at all.
You should send the request to the server within 5 minutes of receiving the authorisation payload from user app.