Payment Result Webhook Events
Payment Result having same callback contract as Get notified of a transaction status change, plus PaymentMethodId field when it is a Account Binding process (Customer Initiated Transaction for future offSession payment)
// Sample for non-USD payments initiated
https://<your_webhook_url>?
TxnId=7715121708032676249
OrderId=365f5Z619951c1a4b8
TotalPrice=1.00
PaymentType=237
ResultCode=0
Checksum=6b6c5e0f835f9f1442726bed3aedc3c9
PayTaxRate=8.00
PayCurrency=MYR
PayAmount=1.00
OriginAmount=1.00
OriginCurrency=MYR
SubTotalPrice=0.93
PaymentMethodId=pmt_9281361551672933 // Only applied to Recurring Binding (CIT for MIT)
// Sample for USD payments initiated
https://<your_webhook_url>?
TxnId=7715122576202672831
OrderId=365f5Z619951c1a4b8
TotalPrice=1.17
PaymentType=237
ResultCode=0
Checksum=10741fa6be7e6f2b189f029b3f8a0963
+ USDPrice=0.30
PayTaxRate=8.00
PayCurrency=MYR
PayAmount=1.17
OriginAmount=0.30
OriginCurrency=USD
SubTotalPrice=1.08
PaymentMethodId=pmt_9281361551672933 // Only applied to Recurring Binding (CIT for MIT)Verify and acknowledge
Verify:
Checksum= MD5(TxnId+apiKey+OrderId+ResultCode), as 32-character lowercase hex.Acknowledge: respond with HTTP 200 and
{"ResultCode": 0}.Retries: Coda sends this notification once and does not retry. If your endpoint does not respond with ResultCode 0, use the Inquiry API to confirm the final status.
Because of retries, you may receive the same notification more than once. Process each TxnId only once (idempotent), for example by checking whether you have already recorded that TxnId before you deliver goods.
Getting the payment method id
PaymentMethodId is included only when a binding payment succeeds. You can take the token from this notification or from PAYMENT_METHOD_ADDED, whichever arrives first. The two notifications can arrive in any order.
Specific Result Code for Recurring:
800
Payment method is not eligible for Merchant-Initiated Transactions (MIT).
Perform a Customer-Initiated Transaction (CIT) before attempting a Merchant-Initiated Transaction
801
Card is not eligible for Merchant-Initiated Transactions (MIT).
Prompt the customer to provide a card type that supports Merchant-Initiated Transactions
802
Re-authentication required. The cardholder or issuing bank revoked the standing mandate, or card details are expired.
Perform a Customer-Initiated Transaction (CIT) to re-authenticate the cardholder and establish a new mandate.
803
Recurring payment declined due to a transient processor or network issue.
Retry the Merchant-Initiated Transaction (MIT) later.
804
Recurring payment declined due to a closed account, stolen/lost card report, or fraud flag.
Stop all retry attempts. Prompt the customer to provide a new payment method.
Refer to overall result code list: https://docs.coda.co/codapay/error-codes
Last updated
Was this helpful?