Recurring Payments

You can perform recurring payments by just adding one additional parameter, recurringType, to the payment request.

A recurring workflow consists of two phases:

  1. Subsequent payment requests without a cvv using a token previously stored during the initial payment.

Sending the initial Payment

During the initial payment, marked by the parameter recurringType with the value INITIAL, the customer is present. Therefore, this initial request should contain additional parameters that authenticate the customer like card.cvv for card payments.

COPYandPAY - INITIAL

In COPYandPAY you get this behaviour out of the box, so all you have to do is to follow the COPYandPAY Integration guide and add the following parameter to the /v1/checkouts request in step 1:

recurringType=INITIAL
createRegistration=true (to create a registrationid for future repeated payments).
curl https://test.oppwa.com/v1/checkouts \
 -d "entityId=8a8294174e918ca6014e9c6f5ae12a9c" \
 -d "amount=1.00" \
 -d "currency=BRL" \
 -d "paymentType=DB" \
 -d "merchantTransactionId=Order Number 123" \
 -d "customer.merchantCustomerId=12345678909" \
 -d "customer.givenName=Jose" \
 -d "customer.surname=da Silva" \
 -d "customer.email= info@provider.com" \
 -d "customer.ip=123.123.123.123" \
 -d "descriptor=123 Usage" \
 -d "billing.city=Sao Paulo" \
 -d "billing.country=BR" \
 -d "billing.state=SP" \
 -d "billing.street1=Rua Itapeva 547" \
 -d "billing.postcode=01332000" \
 -d "customParameters[product]=1 month membership" \
 -d "customParameters[merchant_website]=www.store.com" \
 -d "recurringType=INITIAL" \
 -d "testMode=EXTERNAL" \
 -d "createRegistration=true" \
 -H "Authorization: Bearer OGE4Mjk0MTcyODFiOGVlMzAxMjgyOTkwNjZmNTBjZGJ8ZGVtbw=="

Using the server-to-server integration, you have the option to append the parameter recurringTypeto the initial /v1/payments request which also stores the card data:

Server-to-Server - INITIAL

Using the server-to-server integration, you have the option to append the parameter recurringTypeto the initial /v1/payments request which also stores the card data:

recurringType=INITIAL
createRegistration=true (to create a registrationid for future repeated payments).

For some cases you might want to use an alternative approach: If the shopper just registered his data without sending a payment at the same time, you would have sent his payment directly to the /v1/registrations endpoint as described here. In the same way as described above, the recurringType=INITIAL parameter can be added to the request to indicate that this is the first in a series of recurring payments.

curl https://test.oppwa.com/v1/payments \
 -d "entityId=8a8294174e918ca6014e9c6f5ae12a9c" \
 -d "merchantTransactionId=Order Number 123" \
 -d "customer.merchantCustomerId=12345678909" \
 -d "amount=1.00" \
 -d "currency=BRL" \
 -d "paymentType=DB" \
 -d "paymentBrand=VISA" \
 -d "card.number=4111111111111111" \
 -d "card.holder=Jose da Silva" \
 -d "card.expiryMonth=05" \
 -d "card.expiryYear=2028" \
 -d "card.cvv=123" \
 -d "customer.givenName=Jose" \
 -d "customer.surname=da Silva" \
 -d "customer.email= info@provider.com" \
 -d "customer.ip=123.123.123.123" \
 -d "descriptor=123 Usage" \
 -d "billing.city=Sao Paulo" \
 -d "billing.country=BR" \
 -d "billing.state=SP" \
 -d "billing.street1=Rua Itapeva 547" \
 -d "billing.postcode=01332000" \
 -d "customParameters[product]=1 month membership" \
 -d "customParameters[merchant_website]=www.store.com" \
 -d "recurringType=INITIAL" \
 -d "testMode=EXTERNAL" \
 -d "createRegistration=true" \
 -H "Authorization: Bearer OGE4Mjk0MTcyODFiOGVlMzAxMjgyOTkwNjZmNTBjZGJ8ZGVtbw=="

In the response of the initial transactions, the field “acquirerTxId9” will bring a parameter provided by the card scheme, to be used in the subsequent transactions using this card

Sending a repeated Payment

Any payment request following the initial one must have the parameter recurringType with the value REPEATED. This flag not only indicates that the request is part of a series of payments on this account, but also tells the payment system that no user is present and therefore the parameter card.cvv is not part of the request. This fact in combination with the stored payment data of the registration greatly reduces the number of parameters of such a request:

recurringType=REPEATED

COPYandPAY - REPEATED

curl https://test.oppwa.com/v1/registrations/{id}/payments \
 -d "entityId=8a8294174e918ca6014e9c73d69c2ab3" \
 -d "amount=1.00" \
 -d "currency=BRL" \
 -d "paymentType=DB" \
 -d "customer.merchantCustomerId=12345678909" \
 -d "testMode=EXTERNAL" \
 -d "recurringType=REPEATED" \
 -H "Authorization: Bearer OGE4Mjk0MTcyODFiOGVlMzAxMjgyOTkwNjZmNTBjZGJ8ZGVtbw=="

Server-to-Server - REPEATED

To send the request of a repeated transaction, the field “customParameters[NTR]” must be filled with the information received previously in the initial one, in the field “acquirerTxid9", so the issuers can recognize the recurrency chain of the transaction

curl https://test.oppwa.com/v1/registrations/{id}/payments \
 -d "entityId=8a8294174e918ca6014e9c73d69c2ab3" \
 -d "merchantTransactionId=Order Number 123" \
 -d "customer.merchantCustomerId=12345678909" \
 -d "amount=21.00" \
 -d "currency=BRL" \
 -d "customParameters[NTR]=TEST_NTR_CODE"
 -d "paymentType=DB" \
 -d "recurringType=REPEATED" \
 -d "testMode=EXTERNAL" \
 -H "Authorization: Bearer OGE4Mjk0MTcyODFiOGVlMzAxMjgyOTkwNjZmNTBjZGJ8ZGVtbw=="

Last updated