NICEPAY API
...
Checkout API
Cancel - API Checkout
9 min
tentang api checkout cancel {{api}} ini digunakan untuk membatalkan {{transaksi}} {{yang}} akan berjalan khusus untuk va, {{transaksi}} hanya dapat dibatalkan sebelum melakukan {{proses}} {{pembayaran}} setelah {{transaksi}} dibatalkan, {{pelanggan}} harus kembali melakukan pendaftaran dari awal melalui docid\ fqje 48 bzdt4uimqbfcx api checkout cancel 330,331 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type request parameters 162,59,79,144,298 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type response parameters 184,73,92,230,162 true left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type left unhandled content type sample parameter for cancel api checkout request parameter curl curl location 'https //dev nicepay co id/nicepay/direct/v2/cancel' \\ \ header 'content type application/json' \\ \ data '{ "timestamp" "20251111011147", "imid" "ionpaytest", "txid" "ionpaytest02202511110137007677", "paymethod" "02", "merchanttoken" "0eeb02a32bffdc6309a672b3ef7ea35f8fb2b20c1fda11e4cbdb76313d9f2085", "amt" "10000", "canceltype" "1", "cancelmsg" "cancel testing transaction", "canceluserid" "", "canceluserip" "127 0 0 1", "cancelserverip" "127 0 0 1", "canceluserinfo" "", "cancelretrycnt" "", "worker" "" }' node js const secondapiversion = require(" /lib/secondapiversion js"); const cons = require(" /sharedconfig js"); const config = { isproduction false, iscloudserver false, merchantkey cons merchantkey, }; let parametercancel = { "timestamp" "20251111011147", "imid" "ionpaytest", "txid" "ionpaytest02202511110137007677", "paymethod" "02", "amt" "10000", "canceltype" "1", "cancelmsg" "cancel testing transaction", "canceluserid" "", "canceluserip" "127 0 0 1", "cancelserverip" "127 0 0 1", "canceluserinfo" "", "cancelretrycnt" "", "worker" "" }; let secondversion = new secondapiversion(config); response = secondversion requestapi(parametercancel, "/direct/v2/cancel");config = nicepay builder() isproduction(false) build(); string timestamp = "20251111011147"; string txid = "ionpaytest02202511110137007677"; string imid = "ionpaytest"; string amount = "10000"; cancel requestcancel = cancel builder() timestamp(timestamp) txid(txid) imid(imid) merchanttoken(timestamp, imid, txid, amount, your merchant key) paymethod("02") canceltype("1") amt(amount) cancelmsg("cancel testing transaction") canceluserid("") canceluserip("127 0 0 1") cancelserverip("127 0 0 1") canceluserinfo("") cancelretrycnt("") worker("") build(); nicepayresponsev2 response = v2cancelservice callv2canceltransaction(requestcancel, config);bodycancel = ( buildercancel buildcancel() setpaymethod("02") settxid("ionpaytest02202511110137007677") setcanceluserid("") setcanceltype("1") setcancelmsg("cancel testing transaction") setamt("10000") setcanceluserip("127 0 0 1") setcancelserverip("127 0 0 1") setcanceluserinfo("") setcancelretrycnt("") setworker("") build() ) environment = (builderenvironment buildenvironment() iscloud(false) isproduction(false) build()) response = servicenicepay servicecancel(datagenerator getcancelbody(bodycancel jsoncancel()), environment) c# testingconstantservice config = new testingconstantservice(); // sample constants string merchantkey = config merkey; string clientid = "ionpaytest"; string timestamp = "20251111011147"; string amount = "10000"; string txid = "ionpaytest02202511110137007677"; bool isproduction = false; bool iscloudserver = false; var builder = new merchanttokenbuilder() settimestamp(timestamp) setimid(clientid) settxid(txid) setamount(amount) setmerchantkey(merchantkey); // act menghasilkan merchanttoken string merchanttoken = builder buildcancelmerchanttoken(); var bodybuilder = new nicepayrequestbuilder() setcancel( imid clientid, timestamp timestamp, txid txid, amt amount, merchanttoken merchanttoken, paymethod "02", canceltype "1", cancelmsg "cancel testing transaction", canceluserid "", cancelretrycnt "", ); apiendpoints apiendpoints = new apiendpoints(); dictionary\<string, object> payload = bodybuilder build(); string jsonpayload = newtonsoft json jsonconvert serializeobject(payload); var registrationservice = new nicepayregistrationservice(apiendpoints,isproduction, iscloudserver); var result = await registrationservice sendpostasync(apiendpoints cancelv2,payload); laravel $url = httputil getnicepaydomain($this >useprod, $this >usecloud) $this >cancel endpoint; //request body parameter $timestamp = "20251111011147"; $txid = "ionpaytest02202511110137007677"; $amt = $this >amt; $merchant token = $this >generatemerchanttoken($timestamp, $this >imid, $txid, $this >amt, $this >merchant key); $body = \[ "timestamp" => $timestamp, "txid" => $txid, "imid" => $this >imid, "paymethod" => $this >pay method, "merchanttoken" => $merchant token, "amt" => $amt, "cancelmsg" => "cancel testing transaction", "canceltype" => "1", "cancelserverip" => "127 0 0 1", "canceluserid" => "", "canceluserip" => "127 0 0 1", "canceluserinfo" => "", "cancelretrycnt" => "", "worker" => "" ]; try { $response = httputil postjsonrequest($url, $body); } catch (throwable $th) { return httputil generateerrorresponse($th); } php native $timestampv2 = "20251111011147"; $amount = "10000"; $imid = "ionpaytest"; $merchantkey = testconst $merchant key; $configv2 = nicepay builder() >setisproduction(false) >build(); $config = $configv2; $timestamp = $timestampv2; $txid = "ionpaytest02202511110137007677"; $requestbody = cancel builder() >settimestamp($timestamp) >setimid($this >imid) >settxid($txid) >setmerchanttoken($timestamp, $this >imid, $txid, $this >amount, $this >merchantkey) >setpaymethod("02") >setcanceltype("1") >setamt($this >amount) >setcancelmsg("cancel testing transaction") >setcanceluserid("") >setcanceluserip("127 0 0 1") >setcancelserverip("127 0 0 1") >setcanceluserinfo("") >setcancelretrycnt("") >setworker("") >build(); try { $v2vaservice = new v2vaservice($config); $response = $v2vaservice >cancel($requestbody); }private val v2virtualaccountservice directv2service\<directv2virtualaccount> = directv2virtualaccountserviceimpl() private val timestamp string = "20251111011147" private val txid string = "ionpaytest02202511110137007677" private val imid string = "ionpaytest" private val amount string = "10000" private var config nicepay? = nicepay builder() isproduction(false) build() val request directv2cancel = directv2cancel builder() timestamp(timestamp) txid(txid) imid(imid) merchantkey(testingconstants default merchant key) amt(amount) paymethod("02") canceltype("1") cancelmsg("cancel testing transaction") canceluserid("") canceluserip("127 0 0 1") cancelserverip("127 0 0 1") canceluserinfo("") cancelretrycnt("") worker("") build() val response nicepayresponsev2 = v2virtualaccountservice cancel(request, config)!! codeigniter $config = nicepay builder() >setisproduction(false) >setiscloudserver(false) >build(); $timestamp = "20251111011147"; $txid = "ionpaytest02202511110137007677"; $amount = "10000"; $requestbody = cancel builder() >settimestamp($timestamp) >setimid($this >imid) >settxid($txid) >setmerchanttoken($timestamp, $this >imid, $txid, $amount, $this >merchantkey) >setpaymethod("02") >setcanceltype("1") >setamt($this >amount) >setcancelmsg("cancel testing transaction") >setcanceluserid("") >setcanceluserip("127 0 0 1") >setcancelserverip("127 0 0 1") >setcanceluserinfo("") >setcancelretrycnt("") >setworker("") >build(); try { $v2vaservice = new v2vaservice($config); $response = $v2vaservice >cancel($requestbody); } response parameter sample response { "txid" "ionpaytest02202511110137007677", "referenceno" "ordno20251111011183", "resultcd" "0000", "resultmsg" "success", "transdt" "20251111", "transtm" "013700", "description" "testing transaction", "amt" "10000" }