# 5. Direct Debit Callback

# Description

  • This interface is implemented by the merchant to receive direct debit transaction result notifications
  • PayCools platform actively calls this interface when direct debit transaction status changes

# URL

  • Provided by the merchant

# Request Method

  • POST

# Request Headers

Parameter Name Required Type Description
Content-Type Yes string application/json

# Callback Parameters

Field Name Type Required Description
eventName string Yes Event name: directdebit.payment.success / directdebit.payment.failed
mchOrderId string Yes Merchant order number
transactionId string Yes PayCools unique transaction serial number
amount integer Yes Transaction amount (unit: cents)
transactionStatus string Yes Transaction status: PENDING / COMPLETE / FAILED
createTime string Yes Transaction creation time
returnTime string Yes Callback/return time
channelCode string Yes Payment channel code
remark string No Remark
failedCode integer No Failure code (returned when failed)
failedMessage string No Failure message (returned when failed)
sign string Yes Signature

# Success Callback Example

{
  "eventName": "directdebit.payment.success",
  "mchOrderId": "DD20240101120000",
  "transactionId": "TXN20240101120000123456",
  "amount": 10000,
  "transactionStatus": "COMPLETE",
  "createTime": "2024-01-01 12:00:00",
  "returnTime": "2024-01-01 12:01:30",
  "channelCode": "JTWALLET_DIRECT_DEBIT",
  "remark": "Monthly subscription payment",
  "sign": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"
}

# Failure Callback Example

{
  "eventName": "directdebit.payment.failed",
  "mchOrderId": "DD20240101120000",
  "transactionId": "TXN20240101120000123456",
  "amount": 10000,
  "transactionStatus": "FAILED",
  "createTime": "2024-01-01 12:00:00",
  "returnTime": "2024-01-01 12:01:30",
  "channelCode": "JTWALLET_DIRECT_DEBIT",
  "remark": "Monthly subscription payment",
  "failedCode": -10000,
  "failedMessage": "Transaction Service Error",
  "sign": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"
}

# Response Example

{
  "code":1,
  "msg":"success",
  "data":{
  }
}