Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

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.

Integration Method

PayWithZeta can be integrated using the checkout flowThe details of the flow are described below.

Checkout Flow

The details of the typical checkout flow of the App2App payment support is described below:

  1. User adds items to the cart on the merchant e-commerce app and goes to the checkout page.
  2. User clicks on PayWithZeta option, shown on merchant page, to complete the payment.

  3. 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.
  4. The Zeta app gets the customer’s authorization by overlaying a Swipe to Pay option.

  5. When using Swipe to Pay,

    1. 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.
    2. If the customer denies the authorization, Zeta app will return the Error payload mentioned below.
  6. 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 3.12.25.1 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.

Android Integration

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:

  1. When payment authorization is needed, create the following intent:

    Code Block
    linenumberstrue
    Intent intent = new Intent(Intent.ACTION_VIEW, "zetapay://payAuth");


  2. Prepare the request payload. Convert it to JSON and pass it in the intent.
  3. Add the request payload to the intent, with the key as “data”.

    Code Block
    linenumberstrue
    intent.putExtra("data", payload);


  4. Check if the intent can be handled. 

    Code Block
    linenumberstrue
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("zetapay://payAuth"));
    PackageManager packageManager = getPackageManager();
    if (intent.resolveActivity(packageManager) != null) {
       //Success - app is present and this version of Zeta app can handle the intent
       intent.setPackage("in.zeta.android");
       //Package name for staging - "in.zeta.android.debug"
       //Package name for production - "in.zeta.android"
       intent.putExtra("data", gson.toJson(paymentRequest));
       startActivityForResult(intent, REQUEST_CODE);
    } else {
       //Failure - Zeta app not found/Zeta app is not up to date
    }


    Info

    The intent cannot be found in the older versions of the app. 


  5. Start the activity to see if the intent can be handled, as specified above.

    Code Block
    linenumberstrue
    startActivityForResult(intent, REQUEST_CODE);


  6. On a valid request, swipe to pay screen is launched. On invalid request, the error callback intent is sent as result.

  7. If authorization is successful, activity result is Activity.RESULT_OK, along with the success response payload(JSON) as an intent extra with key “data”.

iOS Integration

Please follow below steps for integration:

  1. Zeta app should be invoked for user’s authorization by invoking a Zeta app URL of the following format:

    Code Block
    linenumberstrue
    zetapay://payAuth?req=<json string>

    The above Zeta app URL is invoked by the openUrl method. 

    Note

    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.


  2. Generate <json string> which is an encoded string version of the request payload using the below code:

    Code Block
    linenumberstrue
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:kNilOptions error:NULL];
    
    NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
    
    jsonString = [string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]];


  3. You must define a custom URL scheme for the callBackUrl, which must be present in the request payload.

    Note
    titleExample

    For a merchant app named Starbucks, the custom URL scheme is starbucks:// and the callBackUrl sent in the request payload is starbucks://zetaAuth.


  4. 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:

    Code Block
    <callBackUrl>?resp=<json string><callBackUrl>?error=<json string>


  5. Convert <json string>, which is a string encoded version of the response payload, to a proper NSDictionary object using the below code:

    Code Block
    linenumberstrue
    https://gist.github.com/apurva14/3016b988056343a603711ffc79e1c3a4


Note

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.

FAQs

Div
classfaq-panel-expand


Expand
titleWhat are Intents?

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.


Expand
titleWhat happens when refunds are not honoured?

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.


Expand
titleDoes App2App work in all versions of Zeta app?

For Android: Zeta app version must be 3.12.25.1 or greater.

For iOS: Zeta app app version must be greater than 2.11.0


Expand
titleDoes the transaction terminate if a user declines the swipe to pay authentication?

The transaction will not be terminated. User will be redirected to web app for completing the transaction. 


Expand
titleWhat is the timeout period when the user is redirected to Zeta app to verify app PIN for order payment?

Timeout period is 30 seconds.


Expand
titleWhat happens when the user has not entered the Zeta app PIN, but App2App payment is attempted ?

The user is directly prompted to swipe2pay and then prompt for PIN if needed, without the need to go to Zeta app at all. 


Expand
titleWhy does the transaction request expire after receiving authorisation payload from user app ?

You should send the request to the server within 5 minutes of receiving the authorisation payload from user app.

Button Hyperlink
titleContact Support
typestandard
classfaq-contact-support
urlhttp://zeta.in/support/
targettrue



Panel


Div
classalignLeftIcon

On this page:

Table of Contents