Payment Result Notification
Backend Notification
According to Credit Cart Payment Flow, PGW will send backend notification message to inform merchant server about concluded payment result. It is merchant’s responsibility to:
- Implement a receiver service to get this payment result message. The message request will share the same schema as response message from /nonUI (paymentTransactionResultItem)
- The receiver service shall properly implement payload decryption the same way as it was encrypted (Payload Encryption)
- Check received message and update payment status on merchant server accordingly
- Provide 2 endpoint URLs for PGW to call to during integration test as well as for production environment.
Sample Backend Notification Request
{
"data": {
"paymentResult": {
"priorPaymentResponseDetails": {
"responseMessageId": "f09110fc-d0ff-4f33-ae06-88e61b788883",
"responseToRequestMessageId": "227fd134-edac-a89a-dd9e-d0a6a9c84bcc",
"responseCode": "PC-B050000",
"responseDescription": "Success",
"responseDateTime": "2022-03-14T05:32:59.3035459Z",
"responseTime": 0,
"marketingDescription": "Payment success.\nThanks you for using our services."
},
"creditCardAuthenticatedDetails": {
"cardNumber": "470680XXXXXX3105",
"cardExpiryMMYY": "XXXX",
"cvvCode": "XXX",
"issuerCode": null,
"cardHolderName": "PGWTESTER01",
"authenticationStatus": "U",
"authenticationStatusReason": null,
"eciValue": "07",
"xidValue": null,
"cavvValue": null,
"issuerBankCountry": "TH"
},
"approvalCode": "552236",
"pspName": "Areeya UAT",
"pspMerchantId": "41113100036",
"failedReason": null,
"pspResponse": {
"responseMessageID": "c5fa1eb8-c1ac-4813-b43e-c30563342e17",
"responseToRequestMessageID": null,
"responseCode": "00",
"responseDescription": "Successful",
"responseDateTime": "2022-03-14T05:32:59Z",
"responseTime": 1647235979,
"approvalCode": "552236",
"pspReferenceNo": "207331061867",
"response63": null,
"responseMetadata": null
},
"paymentExpiryDateTime": "0001-01-01T00:00:00",
"payslipURL": null,
"storedCardUniqueID": null,
"installmentPaymentResults": null,
"transactionDateTime": "2022-03-14T05:32:59.3034732Z",
"orderNo": "ASO_H_AID1IA2304_0R",
"productDescription": "O220314007_202203141231136317",
"invoiceNo2C2P": "BANK0000000000001",
"pspInvoiceNo": "BANK0000000000001",
"pspReferenceNo": "207331061867",
"controllerInternalID": "bab2ee7c29dd4abb833cf32ffd9eab75",
"paymentStatusInfo": {
"paymentStatus": "A",
"paymentStep": "PA",
"lastUpdatedDateTime": "2022-03-14T05:32:57.3600482Z"
},
"paymentType": "CC",
"channelCode": "WEBPAY",
"agentCode": "FPX_SBIA",
"mcpFlag": "N",
"transactionAmount": {
"amountText": "000000500000",
"currencyCode": "THB",
"decimalPlaces": 2,
"amount": 5000.0
},
"settlementAmount": {
"amountText": null,
"currencyCode": null,
"decimalPlaces": 0,
"amount": 0.0
},
"customFieldList": [],
"clientIp": "10.225.73.151",
"officeId": "UATOffice"
},
"autoRedirectDelayTimer": 0
},
"version": "1.0.0",
"apiResponse": {
"responseMessageId": "f09110fc-d0ff-4f33-ae06-88e61b788883",
"responseToRequestMessageId": "227fd134-edac-a89a-dd9e-d0a6a9c84bcc",
"responseCode": "PC-B050000",
"responseDescription": "Success",
"responseDateTime": "2022-03-14T05:32:59.3035459Z",
"responseTime": 0,
"marketingDescription": "Payment success.\nThanks you for using our services."
}
}
Payment Status
Payment status will be returned under paymentStatusInfo which contains Status and Step. Merchant will most of the time only interests in payment status as the step is too deep in detail for troubleshooting purpose. The last updated indicate when is the last time status and/or step changed.
"paymentStatusInfo": {
"paymentStatus": "A",
"paymentStep": "PA",
"lastUpdatedDTTM": "2016-08-29T09:12:35.001Z"
}
Frontend Notification
Front-end notification is simply a redirection with confirmation URL, failedURL or cancellationURL based on payment outcome of success, failed and cancelled respectively. Since the redirection involves round tripping to customer’s browser, this method of notification is prone to be intercepted and tampered with. A merchant shall rely on back-end notification to obtain payment results. 2C2P do not recommend merchant to solely rely on front-end notification for such purpose.
Updated about 2 months ago