SERVER TO SERVER Transaction flow with guide on how handle the 3D Secure Redirect:
For extra guidance please refer to the Developer Portal with Playground
1. Send initial payment request.
This will return the 3D Secure redirect url as well as the 3D Secure parameters and their values. Below is a sample response with 3D redirect parameters.
curl https://test.oppwa.com/v1/payments \ -d "entityId=8ac7xxxxxxxxxxxxxxxxxxx" \ -d "amount=92.00" \ -d "currency=ZAR" \ -d "paymentBrand=VISA" \ -d "paymentType=DB" \ -d "card.number=4111111111111111" \ -d "card.holder=Jane Jones" \ -d "card.expiryMonth=05" \ -d "card.expiryYear=2034" \ -d "card.cvv=123" \ -d "shopperResultUrl=https://peachpayments.docs.oppwa.com/tutorials/server-to-server" \ -H "Authorization: Bearer OGFjN2E0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=="
Response:
{
"id":"8ac7a4a27ee2954a017ee2f89f9d6658",
"paymentType":"DB",
"paymentBrand":"VISA",
"result":{
"code":"000.200.000",
"description":"transaction pending"
},
"card":{
"bin":"411111",
"last4Digits":"1111",
"holder":"Jane Jones",
"expiryMonth":"05",
"expiryYear":"2034"
},
"redirect":{
"url":"https://test.ppipe.net/connectors/demo/simulator.link?ndcid=8ac7a4ca6f138dd0016f13ddeebc00eb_eef7febc639d48dd81a784fa6cc05f8f&REMOTEADDRESS=10.71.36.34",
"parameters":[
{
"name":"TermUrl",
"value":"https://test.ppipe.net/connectors/asyncresponse_simulator;jsessionid=FFBC66FEF8BD9AAADCF9B5D59AFC615F.uat01-vm-con04?asyncsource=THREEDSECURE&ndcid=8ac7a4ca6f138dd0016f13ddeebc00eb_eef7febc639d48dd81a784fa6cc05f8f"
},
{
"name":"PaReq",
"value":"IT8ubu+5z4YupUCOEHKsbiPep8UzIAcPKJEjpwGlzD8#NDExMTExMTExMTExMTExMSM5Mi4wMCBaQVIj"
},
{
"name":"connector",
"value":"THREEDSECURE"
},
{
"name":"MD",
"value":"8ac7a4a27ee2954a017ee2f89fcb665f"
}
]
},
"risk":{
"score":"100"
},
"buildNumber":"7184b1d6ad5298de8fa4dc58ee7bb1dba4d0f65c@2022-02-09 09:02:33 +0000",
"timestamp":"2022-02-10 09:30:51+0000",
"ndc":"8ac7a4ca6f138dd0016f13ddeebc00eb_eef7febc639d48dd81a784fa6cc05f8f"
}
2. Redirect the shopper to the 3D Secure Page by parsing the redirect url and parameters into a form.
Use values returned from the initial payment request response in the sample form below. Please note that the parameters and their values may change with each payment
Use values returned from the initial payment request response in the sample form below. Please note that the parameters and their values may change with each payment
<html><head>
<meta charset="utf-8">
</head>
<body onload="document.form.submit();">
<form name="form" action="https://test.ppipe.net/connectors/demo/simulator.link?ndcid=8ac7a4ca6f138dd0016f13ddeebc00eb_eef7febc639d48dd81a784fa6cc05f8f&REMOTEADDRESS=10.71.36.34", "parameters" target="_self" method="POST">
<input type="hidden" name="connector" value="THREEDSECURE"/>
<input type="hidden" name="MD" value="8ac7a4a27ee2954a017ee2f89fcb665f"/>
<input type="hidden" name="TermUrl" value="https://test.ppipe.net/connectors/asyncresponse_simulator;jsessionid=FFBC66FEF8BD9AAADCF9B5D59AFC615F.uat01-vm-con04?asyncsource=THREEDSECURE&ndcid=8ac7a4ca6f138dd0016f13ddeebc00eb_eef7febc639d48dd81a784fa6cc05f8f"/>
<input type="hidden" name="PaReq" value="IT8ubu+5z4YupUCOEHKsbiPep8UzIAcPKJEjpwGlzD8#NDcxMTEwMDAwMDAwMDAwMCMxMi41MCBaQVIj"/>
<script>
<input type="submit" value="Click here to continue" />
</script>
</form>
</body>
</html>
3. The payment status is returned to you in JSON format.
The payment response for a successful payment in the TEST system will always have a result code of 000.100.110. In the LIVE system, the result code is 000.000.000. Any other result code besides this is a failed payment. Below is the JSON response for a successful payment in the TEST system:
The value marked yellow in the get payment status request below is the Id returned from the initial payment request response
curl -G https://test.oppwa.com/v1/payments/8ac7a4a27ee2954a017ee2f89f9d6658 \
-d "entityId=8ac7xxxxxxxxxxxxxxxxxxx" \
-H "Authorization: Bearer OGE4Mjk0MXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=="
Response
{ "id":"8ac7a4a27ee2954a017ee2f89f9d6658", "paymentType":"DB", "paymentBrand":"VISA", "amount":"92.00", "currency":"ZAR", "descriptor":"Peach Test 3DS 1919.7603.1787", "result":{ "code":"000.100.110", "description":"Request successfully processed in 'Merchant in Integrator Test Mode'" }, "card":{ "bin":"411111", "binCountry":"US", "last4Digits":"1111", "holder":"Jane Jones", "expiryMonth":"05", "expiryYear":"2034" }, "threeDSecure":{ "eci":"05", "verificationId":"AAACAgSRBklmQCFgMpEGAAAAAAA=", "xid":"CAACCVVUlwCXUyhQNlSXAAAAAAA=", "paRes":"pares" }, "customParameters":{ "CTPE_DESCRIPTOR_TEMPLATE":"${INVOICE_ID} ${CHANNEL_NAME} ${SHORT_ID}" }, "risk":{ "score":"100" }, "buildNumber":"7184b1d6ad5298de8fa4dc58ee7bb1dba4d0f65c@2022-02-09 09:02:33 +0000", "timestamp":"2022-02-10 09:38:05+0000", "ndc":"8ac7a4ca6f138dd0016f13ddeebc00eb_97c16d26f9fd4728a3b6700e39282833" }
Useful Server to Server Articles:
- Server to Server: How to Add and Save Card for Recurring Payments
- Credentials on File Changes - Card Storage (Tokenization)
- Do I have to be PCI compliant to use server to server integration