Customer : Add and save a card in CopyAndPay

Follow

When a customer adds a card, a PA transaction needs to be processed.

This will validate the card and once validated, store the card details and return a payload.

The payload (response from our systems) will include a registrationID, which you can save as the token of the card. You can then make payments on this stored card by referencing its token.


From an implementation perspective what this means is that you simply change the CheckoutID request from Step 1 (CopyAndPay) to :


paymentType = PA
Amount = ZAR 1.00


Main reason why you cannot do a RG and then a DB :


- The RG does not go to the bank and therefore will not be authenticated (the banks only process transactions with an amount - we also cannot attach an amount to the RG, since amounts will differ in the future). Processing an RG only therefore may store a card that cannot be billed.

This R1.00 is a pre-authorisation transaction on the client's card, of R1.00 since there is no checkout when a customer adds a card ; i.e,. your workflow is

- Add a card
- Book a service
- On return, select a card for payment / add a new card to checkout with

This is R1.00 PA is done to check that the card being added is valid, before you store the card for future billing.

This R1.00 amount should return to the customer's account after a period ; i.e, their balance will increase by R1.00 when the PA falls away (period differs from bank to bank).

If this R1.00 PA is not done, first of all the card storage transaction cannot be 3DSecure authenticated and secondly, you may store cards that later cannot be billed at a later stage. This does not ensure that you can charge the full amount (since most likely the basket value would be greater than R1.00), but it at least checks with the bank that the card is valid.



Sample code below:

function request() {
$url = "https://test.oppwa.com/v1/checkouts";
$data = "authentication.userId=XXXXXXXXX".
"&authentication.password=XXXXXX" .
"&authentication.entityId=XXXXXXXXXXXX" .
"&amount=1.00" .
"&currency=ZAR" .
"&paymentType=PA"
"&createRegistration=true"

"&RecurringType=INITIAL"

 

 You can then store the card (the registrationID) in your database against the customer's user profile, ONLY IF the PA transaction is successful.

 

Have more questions? Submit a request

Comments

Powered by Zendesk