Payment Instruction

👍

HTTPS POST / Server-to-Server

Payment requests and responses are encrypted using JWT

  • Algorithm : HMAC SHA-256 using Merchant’s Secret Key.

Refer JWT Token Guide on how to prepare requests and process responses.

https://sandbox-pgw.2c2p.com/payment/4.3/paymentInstruction
https://pgw.2c2p.com/payment/4.3/paymentInstruction

 

Payment Instruction API allows merchant to retrieve payment instruction guide and show to their customers.

📘

API Parameter

Payment Instruction Request Parameter
Payment Instruction Response Parameter

Prepare Payment Instruction Request


  1. Prepare payload data.
  2. Encrypt payload data with JWT - HS256 algorithm using merchant secret key.
{ "merchantID": "JT", "agentCode": "THSCB", "agentChannelCode": "BANKCOUNTER" }
{ "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiSlQiLCJhZ2VudENvZGUiOiJUSFNDQiIsImFnZW50Q2hhbm5lbENvZGUiOiJCQU5LQ09VTlRFUiJ9.9PN1PFnkSkGtn-0DYJwF78YWiQjZzzI1ISMk0-hJWkA" }
  1. Send request to payment instruction API.
curl --location --request POST 'https://sandbox-pgw.2c2p.com/payment/4.3/paymentInstruction' \ --header 'Content-Type: application/json' \ --data-raw '{ "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiSlQiLCJhZ2VudENvZGUiOiJUSFNDQiIsImFnZW50Q2hhbm5lbENvZGUiOiJCQU5LQ09VTlRFUiJ9.9PN1PFnkSkGtn-0DYJwF78YWiQjZzzI1ISMk0-hJWkA" }'

 

Receive Payment Instruction Response


  1. Receiving encrypted payment instruction data immediately.
  2. Decrypt payload data with JWT - HS256 algorithm using merchant secret key.
{ "merchantID": "JT", "agentCode": "THSCB", "agentChannelCode": "BANKCOUNTER", "instructions": [{ "language": "TH", "content": ["1. āļ™āļģāļšāļīāļĨāđ„āļ›āļ—āļĩāđˆ SCB Bank āļ—āļļāļāļŠāļģāļ‚āļģ", "2. āļĒāļ·āđˆāļ™āļšāļīāļĨāļ™āļĩāđ‰āđƒāļŦāđ‰āļžāļ™āļąāļāļ‡āļģāļ™āļŠāđāļāļ™āļšāļģāļĢāđŒāđ‚āļ„āđ‰āļ”", "3. āļŠāļģāļĢāļ°āļ„āđˆāļģāļŠāļīāļ™āļ„āđ‰āļģāđāļĨāļ°āļšāļĢāļīāļāļģāļĢāļ•āļģāļĄāļĒāļ­āļ”āđ€āļ‡āļīāļ™"] }, { "language": "EN", "content": ["1. Bring this slip to SCB Bank.", "2. Hand this slip to counter.", "3. Pay goods and services."] }], "respCode": "0000", "respDesc": "success" }
{ "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiSlQiLCJhZ2VudENvZGUiOiJUSFNDQiIsImFnZW50Q2hhbm5lbENvZGUiOiJCQU5LQ09VTlRFUiIsImluc3RydWN0aW9ucyI6W3sibGFuZ3VhZ2UiOiJUSCIsImNvbnRlbnQiOlsiMS4g4LiZ4Liz4Lia4Li04Lil4LmE4Lib4LiX4Li14LmIIFNDQiBCYW5rIOC4l-C4uOC4geC4quC4s-C4guC4syIsIjIuIOC4ouC4t-C5iOC4meC4muC4tOC4peC4meC4teC5ieC5g-C4q-C5ieC4nuC4meC4seC4geC4h-C4s-C4meC4quC5geC4geC4meC4muC4s-C4o-C5jOC5guC4hOC5ieC4lCIsIjMuIOC4iuC4s-C4o-C4sOC4hOC5iOC4s-C4quC4tOC4meC4hOC5ieC4s-C5geC4peC4sOC4muC4o-C4tOC4geC4s-C4o-C4leC4s-C4oeC4ouC4reC4lOC5gOC4h-C4tOC4mSJdfSx7Imxhbmd1YWdlIjoiRU4iLCJjb250ZW50IjpbIjEuIEJyaW5nIHRoaXMgc2xpcCB0byBTQ0IgQmFuay4iLCIyLiBIYW5kIHRoaXMgc2xpcCB0byBjb3VudGVyLiIsIjMuIFBheSBnb29kcyBhbmQgc2VydmljZXMuIl19XSwicmVzcENvZGUiOiIwMDAwIiwicmVzcERlc2MiOiJzdWNjZXNzIn0.V71cflQPw_2YuHQgkQmalOCBd09ab_aYwssGqeEypDo" }