Resend Callback For Transaction

Resend Callback For Transaction คือบริการที่ใช้สำหรับตรวจสอบสถานะของรายการที่กำหนด โดยระบบจะส่งข้อมูลสถานะล่าสุดกลับไปยัง Callback URL ที่กำหนดไว้สำหรับรายการนั้น

โดยสามารถดำเนินการเรียกใช้ api ได้เฉพาะในกรณีที่รายการมีสถานะเป็น AUTO_SUCCESS, SUCCESS หรือ FAILED เท่านั้น

รายละเอียด Endpoint

POST /api/v1/client/resend_callback_for_transaction

Headers

Name
Value

Authorization

Bearer YOUR_SECRET_TOKEN

x-api-key

YOUR_API_KEY

x-signature

YOUR_BASE64_ENCODED_SIGNATURE

Body

{
  "ref_id": ""
}
Fields
Type
Required
Description

txn_ref_id

string

Required

ref_id ของรายการที่ต้องการตรวจสอบ


ตัวอย่างการเรียกใช้งาน (Request Example)

curl -X POST https://BASE_URL/api/v1/client/resend_callback_for_transaction \
-H "Authorization: Bearer YOUR_SECRET_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-signature: YOUR_BASE64_ENCODED_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
  "ref_id": "your_ref_id_here"
}'

การตอบกลับจาก API (Response Example)

{
    "status": "SUCCESS"
}

JaveScript Example

const axios = require('axios')

try {
  const { data } = await axios.post(
    `${baseUrl}/api/v1/client/resend_callback_for_transaction`,
    {
      ref_id: 'ref-123456789',  // ตัวแปร ref_id ที่จะส่งไปใน request
    },
    {
      headers: {  // headers ที่ใช้ในการส่งคำขอ HTTP
        Authorization: 'Bearer YOUR_ACCESS_TOKEN',  // การให้สิทธิ์ด้วย Bearer token
        'x-api-key': 'YOUR_API_KEY',  // กุญแจ API
        'x-signature': 'YOUR_BASE64_ENCODED_SIGNATURE',  // ลายเซ็นที่เข้ารหัส
      },
    },
  )

} 

Last updated