NICEPAY API
...
API E-Wallet
AstraPay Payment - API E-Wallet
15 min
about api e wallet astrapay payment through , offers you convenience of cross application s (jump app) for your s notifications will be sent to s in real time as soon as s complete s visit docid\ cmd9efdsw7mptws1elyfc to acknowledge flow difference between general with astrapay api e wallet astrapay payment using aims to activate at s, so that s can make s using with s this stage is to integrate with api url nicepay/api/linkinitiate do request method pop up, redirect, submit pop up, redirect, submit description performs request to header content type application/form merchant token sha256( imid + referenceno + amt + merchantkey ) request format application/x www form urlencoded the can only be after going through registration , please learn further about astrapay registration on docid 8qytjgylymk7zndm8zncz request parameter for e wallet astrapay payment the following is a list of s for requesting registration of astrapay this is used through platform as one of stages so that 's can connect with s from parameter type size description example / notes timestamp required required n 14 request timestamp ( yyyymmddhh24miss ) 20210315112359 imid required required an 10 id ionpaytest mandateid required required n 40 mandate id ionpaytest123412345 paymethod required required n 2 docid\ ek 0djw7nuhytcda4sa3p 05 currency an 3 currency idr amt n 12 amount 10000 goodsnm an 100 goods name john doe referenceno required required ans 40 's reference number ord54321 billingnm required required a 100 buyer name john doe billingphone required required n 15 buyer phone number 08123456789 billingemail required required ans 40 buyer email email\@merchant com billingaddr an 100 buyer address jln merdeka 123 billingcity a 50 buyer city jakarta selatan billingstate 1 50 billing state dki jakarta billingpostcd n 10 billing post number 14350 billingcountry a 10 billing country deliverynm a 30 delivery name john doe deliveryphone n 15 delivery phone 8124125931 deliveryaddr an 100 delivery address jln merdeka riau 161 deliverycity a 50 delivery city riau deliverystate a 50 delivery state riau deliverypostcd n 10 delivery post code 14350 deliverycountry a 10 delivery country cartdata required required jsonstring 4000 cart data {"count" 1,"item" \[{"goods name" "casandra blush on","goods detail" "casandra blush on","goods amt" "{{amt}}","goods quantity" "1","img url" "https //image freepik com/free psd/simple black men s tee mockup 53876 57893 jpg"}]} mitracd required required a 4 docid 0upx1lyg1o2f4biu3ssp astr userip required required an 15 user ip 127 0 0 1 dbprocessurl required required ans 255 notification url https //merchant com/dbprocessurl merchanttoken required required an 255 token a45e163042746131307bad89ef6cc0c517c136895a6cfe6cb77c4a62ce1ee5b3 description an 100 transaction description test transaction userip required required an 15 user ip address 127 0 0 1 returnjsonformat an 100 return json format 1 return redirect url app and redirect url http or empty/ 0 return html to redirect callbackurl an 255 result page visit docid\ mkxgm04 smrzpcmmynuk0 to learn general about response parameter for e wallet astrapay payment following are response s from the results of request s for of astrapay parameter type size description example / notes resultcd n 4 docid 2r5sr3xvppu1eju1nitg 0000 resultmsg an 255 result message docid 4 fpewlvczfhcvygxwck9 success txid an 30 transaction id ionpaytest05202212121533119647 mandateid an 40 instead of signature token ionpaytest085695655726 referenceno ans 40 reference number ncpy20221214121608 paymethod n 2 docid\ ek 0djw7nuhytcda4sa3p 05 amt n 12 amount 2123 transdt n 8 transaction date ( yyyymmdd ) 20221214 transtm n 6 transaction time ( hh24miss ) 121608 mitracd a 4 docid 0upx1lyg1o2f4biu3ssp astr redirecturlhttp ans 255 redirect to page https //apis astrapay com/merchant service/payments/e574e878 d37f 491e ba78 08e55de73d7 sample json for e wallet astrapay payment form urlencode request timestamp={timestamp} imid={imid} mandateid={mandateid} referenceno={referenceno} paymethod={paymethod} currency={currency} amt={amt} goodsnm={goodsnm} billingnm={billingnm} billingphone={billingphone} billingemail={billingemail} billingaddr={billingaddr} billingcity={billingcity} billingstate={billingstate} billingpostcd={billingpostcd} billingcountry={billingcountry} deliverynm={deliverynm} deliveryphone={deliveryphone} deliveryaddr={deliveryaddr} deliverycity={deliverycity} deliverystate={deliverystate} deliverypostcd={deliverypostcd} deliverycountry={deliverycountry} description={description} userip={userip} cartdata={cartdata} callbackurl={callbackurl} dbprocessurl={dbprocessurl} merchanttoken={merchanttoken} mitracd={mitracd} returnjsonformat={returnjsonformat} json response { "resultcd" "0000", "resultmsg" "success", "txid" "ionpaytest05202212141216111291", "mandateid" "ionpaytest085695655726", "referenceno" "ncpy20221214121608", "paymethod" "05", "amt" "2123", "transdt" "20221214", "transtm" "121608", "mitracd" "astr", "redirecturlhttp" "https //apis astrapay com/merchant service/payments/e574e878 d37f 491e ba78 08e55de73d78" } java request //e wallet astrapay payment// nicepay settimestamp("20221214065959"); nicepay setimid("ionpaytest"); nicepay setmandateid("082111111111"); nicepay setpaymethod("05"); nicepay setcurrency("idr"); nicepay setamt("2000"); nicepay setreferenceno("ordno20221214065959"); nicepay setdecription("test ewallet astrapay"); nicepay setmerchanttoken(nicepay maketoken(nicepay getmerchanttoken()); nicepay setgoodsnm("testing payment astrapay"); nicepay setbillingnm("john doe"); nicepay setbillingphone("082111111111"); nicepay setbillingemail("john doe\@example com"); nicepay setbillingaddr("jln raya kasablanka kav 88"); nicepay setbillingcity("south jakarta"); nicepay setbillingstate("dki jakarta"); nicepay setbillingcountry("indonesia"); nicepay setbillingpostcd("12800"); nicepay setcallbackurl("http //ptsv2 com/t/merchant/post"); nicepay setdbprocessurl("http //ptsv2 com/t/merchant/post"); nicepay setcarddata("{\\"count\\" 1,\\"item\\" \[{\\"img url\\" \\"http \\\\\\/\\\\\\/www jamgora com\\\\\\/media\\\\\\/avatar\\\\\\/noimage png\\",\\"goods name\\" \\"hoodie\\",\\"goods detail\\" \\"hoodie\\",\\"goods amt\\" \\"2000\\"}]}"); nicepay setmitracd("astr"); nicepay setreturnjsonformat("1"); // request e wallet astrapay payment nicepay ewalletastrapayment(); // 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 mandateid = nicepay get("mandateid"); string referenceno = nicepay get("referenceno"); string paymethod = nicepay get("paymethod"); string amt = nicepay get("amt"); string transdt = nicepay get("transdt"); string transtm = nicepay get("transtm"); string mitracd = nicepay get("mitracd"); cart data e wallet astrapay payment cartdata in registration is useful for declaring what items will be checked out along with item details and price per item parameter description example / notes count total from all card data 2 item divide into 4 type, such as img url , goods name , goods detail and goods amt detailed explanation on item s parameter description example / notes img url goods picture url (ukuran 50px x 50px) htttps\ //www merchant com/image goods1 jpg goods name goods name nama item 1 goods detail goods detail description detail item 1 goods amt goods price 1000 cartdata e wallet astrapay payment { "count" "2", "item" \[ { "img url" "http //www merchant com/image goods1 jpg", "goods name" "item 1 name", "goods detail" "item 1 detail", "goods amt" "1000", "goods quantity" "1" }, { "img url" "http //www merchant com/image goods2 jpg", "goods name" "item 2 name", "goods detail" "item 2 detail", "goods amt" "1000" "goods quantity" "1" } ] } callback e wallet astrapay payment when your callback already received callbackurl , recommended to do verification using docid\ tegpdwiwlqpwiik9vv3r4 callback handling can be very helpful to minimize occurrence of fraud, highly recommend to do verification using callback handling request body { "resultcd" "0000", "resultmsg" "success", "txid" "ionpaytest05202212141753501704", "mandateid" "ionpaytest082111111111" "referenceno" "ncpy20221214175347", "paymethod" "05", "amt" "10000", "transdt" "20221214", "transtm" "113441", "mitracd" "astr" } url callback https //merchant co id/nicepay callback?string=\&resultcd=0000\&resultmsg=success\&txid=ionpaytest05202212141753501704\&mandateid=ionpaytest085695655726\&referenceno=ncpy20221214175347\&paymethod=05\&transdt=20221214\&transtm=175350\&mitracd=astr\&amt=10