One Tap-iOS – PayU Documentation

One Tap iOS

Pre-requisites

1. iOS Mobile SDK to accept payments

2. Mobile Custom Browser

3. Store Card feature

Steps Involved

 

The functioning of One Tap has two parts, where our SDKs takes care of the part of making the transaction CVV less and our Custom Browser takes care of automatically selecting the customer’s OTP. Accordingly the integration that follows is divided into two parts:

SDK:

  1. Enrolling a card, an already stored card or a fresh card, for One Tap Payment.
  2. Making payment as One Tap payment by sending the information to SDK
  3. Deleting a One tap card.

Custom Browser:

  1. Enable parameters to automatically select the OTP.

Subscribe a card as One Tap card

 

UI change

In StoredCard & CCDC screen create a checkbox, which should ask user to enroll card for CVV less payments (Refer sample app for more details)

Converting an already stored card to One tap card

If a customer wants to enrol an existing stored card for CVVless payments all you need to do is send us one extra parameter (self.paymentParam.isOneTap = YES;) during the transaction to the otherwise existing flow of store card feature.

The sample code form with all the parameters required for enrolling an existing stored card for CVV less payments is

 

Converting a fresh Credit/ Debit card to One Tap card

If a customer wants to enrol  a fresh CC/DC card for cvvless payments you need to  send an extra parameter (self.paymentParam.isOneTap = YES;) during the transaction to the otherwise existing flow of CC/DC.
Code of line that needs to be added

the  sample code form with all the parameters required for enrolling a fresh CC/DC for CVV less payments is

Response

 

Once the payment is successful, SDK will give callback in “PayUSuccessResponse:” method This is a method of PayUSDKWebViewResponseDelegate protocol.Your UIWebView must adhere to this protocol (Refer sample app for more details). The response comes in key value pair. From the response save “merchant_hash” corresponding to the given “card_token” and “user_credential” which you will be receiving under “PayUSuccessResponse:” method and save it on your server.

Making payment via a One tap card

 

In order to do a transaction by using a card that has already been enrolled for CVV less you would need to do the following

Fetch merchant hashes and card_token from your server

The first step towards making a transaction via One tap would be to fetch all the merchant hashes and card_tokens for a user from your database.

Fetch store cards from Payu server

You would need to fetch all the stored cards from PayU for a customer to choose one of the store cards to make payment. You have to do this by calling our API payment_related_details_for_mobile_sdk.

To use payment_related_details_for_mobile_sdk:

 

POST

 

In order to retrieve all the store cards, you need to make a server to server call on the following URL with certain parameters:

Environment URL
Test https://test.payu.in/merchant/postservice.php?form=1
Live https://info.payu.in/merchant/postservice.php?form=1

 

Parameters:

Parameter Description Sample value
Key Your key provided by payu gtKFFx
Command Name of web service call payment_related_details_for_mobile_sdk
hash Security parameter e54de882e2b14c13424c91a4855fea2dc9b2a3a9525531408beec97564dd336460e22d72770ba37a5fcb6bad76d042582e87cc26b34741b6b6747e6b5b71b2cc
User_credentials Identification parameter of customer gtKFFx:payutest@payu.in

You would need to send all the parameters in the following mentioned format

Response

Making a post request for payment

 

Among the one tap cards returned, customer chooses a card, and you would need to send to the card_token and corresponding merchant_hash of the card chosen along with the other payment parameters as you would’ve for stored card transaction.

Now the form has to be submitted to PayU SDK, the sample code of which is as follows

Deleting One Tap cards

 

Deleting a card

If your customer chooses to delete a card, it can be done by making an API call to PayU. All you need to do is:

Post:

Environment URL
Test https://test.payu.in/merchant/postservice.php?form=1
Live https://info.payu.in/merchant/postservice.php?form=1

Parameters:

Parameter Description Sample value
Key Your key provided by payu gtKFFx
Command Name of web service call DELETE_USER_CARD
hash Security parameter e54de882e2b14c13424c91a4855fea2dc9b2a3a9525531408beec97564dd336460e22d72770ba37a5fcb6bad76d042582e87cc26b34741b6b6747e6b5b71b2cc
var1=User_credentials Identification parameter of customer gtKFFx:payutest@payu.in
var2=Card_token Identification parameters of Card

You would need to send all the parameters in the following mentioned format

Change in Custom Browser

 

The first and foremost task to get started with One tap would be to set the following parameters true in your custom browser code:

Parameter Value Found in line
isAutoOTPSelect YES PayUUIPaymentUIWebViewController :51

Still have questions?

Our team will be more than happy to help you out. You can reach out to them at tech@payu.in