Store Card- Web – PayU Documentation

Store card- Web

Pre-requisites

  • Test Key and salt
  • Live key and salt
  • PayU payment API’s.

For hosted page

 

Steps Involved

To save a card

  1. Along with the POST request parameters, an extra parameter needs to be sent to identify the user.
  2. On PayUbiz payment page, an option called “Store this Card” is shown, which triggers the card storing process.

Parameter to identify a user

Following parameter has to be passed along with other mandatory parameters used for transactions via hosted page.

Parameter Description Value
user_credentials Used to identify each unique user, to show the option of saving a card, on payment page. <merchant_key:unique_customer_identifier>
merchant_key: Unique merchant key provided by payu.

Please note both variables are seperated by a ‘:’

unique_customer_identifier: unique value to identify a customer, be it email id, phone or any unique string

Examples:

So, for example, if the merchant_key is JBiPgT, then examples of user_credentials are as below:

  1. a) JBiPgT:test@example.com – [Email ID used here]
  2. b) JBiPgT:9999999999 – [Phone number used]
  3. c) JBiPgT:123456 – [Numeric Value]
  4. d) JBiPgT:ertyui12fgh5jasas – [String used]

After the parameter user_credentials is passed on to PayU, an option of saving the card and adding a custom label to it is presented to customer, which on clicking would save the card for any future visits.

Screen Shot 2016-04-21 at 11.33.54 AM

To use a saved card

 

Now, when the customer visits again on your website and wants to transact using Stored Card all you need to do is pass on the same user_credentials parameter along with the other mandatory parameters. The customer would be shown all the previously stored cards as shown below.

Screen Shot 2016-04-21 at 12.56.54 PM

Here, the customer simply needs to enter the CVV and go ahead with the transaction. If the customer wants to use a fresh card, then he/she needs to click on the dropdown provided in ‘Select your card’.

If the customer wants to delete a card, he/she needs to click on ‘Manage this Card’ option on the right hand side. Below screen will appear and the customer can remove the stored card from Database

 

Screen Shot 2016-04-21 at 1.02.41 PM

For Embedded form

 

To save a card

  1. Make an HTTP POST request with new parameters along with  other mandatory parameters .
  2. After the transaction is complete, store the card_token parameter which you receive as the response of the transaction.
Additional Parameters to be posted

 

Parameter Description Value
User_credentials Used to identify each unique user, to show the option of saving a card, on payment page. <merchant_key:unique_customer_identifier>
merchant_key: Unique merchant key provided by payu.

unique_customer_identifier: unique value to identify a customer, be it email id, phone or any unique stringStore_cardTo store a card, this parameter has to be 11Card_name (non-mandatory)For setting a nickname/ custom label to the cardstring

Examples of user_credentials:

If the merchant_key is JBiPgT, then examples of user_credentials are as below:

Once all these parameters are passed and a successful transaction is carried out, the card information will be saved in Payu’s database and merchant will receive a card token that needs to be stored securely in their database.

JS

Response

Use a saved card

 

To carry out a transaction with an already saved card, certain parameters needs to be replaced as per the details in the table below.

Parameter to be replaced Value New Parameter Example
ccnum As filled by customer Card_token
ccname As filled by customer
ccexpmon As filled by customer
ccexpyr As filled by customer
store_card 1

Now, card_token can be retrieved in a couple of ways:

  1. Retrieving it from your database, as it was received in the response of previous transaction, in which the card was saved.
  2. Using Payu’s web service API, get_user_cards.

To use get_user_cards:

POST

In order to retrieve the customer’s card token, 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

Parameters:

Parameter Description Sample value
key Your key provided by payu JBiPgT
command Name of web service call get_user_card
hash Security parameter— SHA512(key|command|var1|salt)
user_credentials Identification parameter of customer  JBiPgT:9999999999

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

JS

Response

Delete store cards

 

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

 

Parameters:

Parameter Description Sample value
key Your key provided by payu  JBiPgT
command Name of web service call  delete_user_card
hash Security parameter— SHA512(key|command|var1|salt)
user_credentials Identification parameter of customer  JBiPgT:9999999999
card_token  Identification parameter of card

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

NOTE: It is absolutely important for you to maintain a database of user_credetials, as other details like card token can also be retrieved via a web service API.

JS

Response

Still have questions?

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