NICEPAY API
...
Payment API
API GPN
Cancel - API GPN
13min
about api gpn cancel this {{api}} uses to cancel {{the}} paid {{transaction}} if {{the}} {{transaction}} cancels before {{the}} settlement {{process}} is done, then that {{transaction}} will consider void, and that fund {{transaction}} will return to your {{customer}} api gpn cancel the {{gpn}} {{api}} uses to cancel {{system}} for {{payment}} s via {{gpn}} api endpoint /nicepay/direct/v2/cancel request method post post header content type application/json merchant token sha256( timestamp + imid + txid + amt + merchantkey ) payment methods available for cancel code paymethod 01 {{cc}} 02 {{va}} 03 {{cvs}} 04 {{directdebit}} 05 {{ewallet}} 06 {{payloan}} 08 {{qris}} 09 gpn gpn request parameters for gpn cancel the following is a list of {{parameter}} s for requesting {{integration}} of {{the}} cancel {{payment}} {{process}} on {{the}} {{gpn}} {{paymethod}} these {{parameter}} s use via {{the}} {{api}} {{testing}} platform parameter type size description example / notes timestamp required required n 14 {{api}} request timestamp 20180123100505 txid required required an 30 transaction id ionpaytest01202103311759347262 imid required required an 10 {{merchant}} id ionpaytest paymethod required required n 2 {{paymentproduct}} method 09 canceltype required required n 2 cancel type 1 merchanttoken required required an 255 {{merchant}} token 66141d60572e570045c4f3e9965f3452d511496841981e8a2af6a24a7038a119 amt required required n 12 {{paymentproduct}} amount 10000 cancelmsg an 255 cancel message request cancel preauthtoken an 100 pre auth token referenceno (optional for cc) (optional for cc) ans 40 {{merchant}} cancel number cancelno20160525000 52104 cancelserverip an 15 server ip 127 0 0 1 canceluserid an 30 user id admin canceluserip an 15 user ip 127 0 0 1 canceluserinfo an 100 user information test cancel cancelretrycnt 	 n 2 retry count 3 worker an 10 worker response parameter for gpn cancel following are {{the}} response {{parameter}} s from {{the}} results of {{the}} request {{parameter}} s for {{integration}} of {{the}} {{gpn}} to cancel parameter type size description example / notes resultcd n 4 result code docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 result message error code docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id ionpaytest01202103311759347262 referenceno ans 40 {{merchant}} order number ord20210331170394 transdt n 8 transaction date 20210331 transtm n 6 transaction time 175934 amt n 12 amount 10000 cancelreferenceno (optional for cc) (optional for cc) an 40 {{merchant}} cancel number cancelno20160525000 52104 sample json for gpn cancel json request { "timestamp" "20180123100505", "txid" "ionpaytest01202103311759347262", "imid" "ionpaytest", "paymethod" "09", "canceltype" "1", "cancelmsg" "request cancel", "merchanttoken" "66141d60572e570045c4f3e9965f3452d511496841981e8a2af6a24a7038a119", "preauthtoken" "", "amt" "10000", "cancelserverip" "127 0 0 1", "canceluserid" "admin", "canceluserip" "127 0 0 1", "canceluserinfo" "test cancel", "cancelretrycnt" "3", "referenceno" "cancelno20160525000 52104", "worker" "" } json response { "txid" "ionpaytest01202103311759347262", "referenceno" "ord20210331170394", "resultcd" "0000", "resultmsg" "success", "transdt" "20210331", "transtm" "175934", "amt" "10000", "cancelreferenceno" "cancelno20160525000 52104" } java request //cancel registration// nicepay settimestamp("20221114114338"); nicepay setimid("ionpaytest"); nicepay setamt("10000"); nicepay setreferenceno("ordno20221202141217"); nicepay setmerchanttoken(nicepay maketoken(nicepay getmerchanttoken()); nicepay settxid("ionpaytest01202103311759347262"); nicepay setpaymethod("09"); nicepay setcanceltype("1"); nicepay setcancelmsg("request cancel"); nicepay setcancelserverip("127 0 0 1"); // request cancel nicepay cancel(); // response string // system out println("final response string " + nicepay getresponsestring()); string resultcd = nicepay get("resultcd"); string resultmsg = nicepay get("resultmsg"); string txid = nicepay get("txid"); string referenceno = nicepay get("referenceno"); string amt = nicepay get("amt"); string cancelreferenceno = nicepay get("cancelreferenceno");