Pay in - API mode

Description

In some case, merchant would like to rendering checkout page with customized requirements for example, merchant's logo, style.

Request URL

https://payment.alchemytech.cc/nh-gateway/card/payment

Http method

  • POST
  • Content-Type: application/x-www-form-urlencoded

Http request

ElementData TypeRequiredSignedAES encryptionURL encodeRemarks
merchantNostringRYmerchant unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials
timeStampstringRYGMT time with 13 digit to represent time in milliseconds
languagestringONen
signstringRNsignature with RsaUtil.sign method
merchantOrderNostringRYmerchant defined transaction ID, must be unique for each request.
payTypestringRYINTERNATIONAL_CARD_PAY
payModelstringRYeither CREDIT_CARD or DEBIT_CARD
currencystringRYUSD, EUR, GBP, JPY
orderAmountstringRYtransaction amount,
unit in cents (i.e. 100 = $1)
productDetailstringRYYgoods name, can't contain special characters
cardNostringRYYbank Card No.
cardTypestringRYVISA, MASTERCARD, UPI, JCB
cardCcvstringRYYcvv
cardExpMonthstringRYformat: mm
cardExpYearstringRYformat: yyyy
firstNamestringRYYcard holder's first name
lastNamestringRYYcard holder's last name
phonestringCY
addressstringCY
citystringCYY
statestringCNfor USA and Canada, it is ISO 3166-1 alpha-2, for others countries please use full name, in case there is no state in your country, please use city name instead.
countrystringCYcountry code with two letters defined in ISO 3166-1
emailstringRY
postcodestringCN
userIpstringRNuser's IP
userAgentstringONuserAgent of explorer: Mozilla/5.0 Macintosh, Intel Mac OS X
callbackUrlstringRYwebhook URL
noticeUrlstringONredirect URL in case 3DS verification is triggered and payment succeed. for example: https://www.alchemypay.org
customParamstringONcustomized data with maximum 500 characters after redirect to noticeUrl, for example: https://www.alchemypay.org?customParam={customParam}
expandFieldstringONNULL
versionstringONNULL
validPeriodstringONNULL
merTypestringCNeither 0 or 1, default value is 0.
with value=1, phone, address, city, country, state, postCode is optional, with value=0, phone, address, city, country,state, postCode is necessary.

Http response

ElementData TypeSignedRemarks
merchantNostringYmerchant unique ID, once a merchant has been on-boarded with Alchemy Pay, the merchant will be provided with the credentials
merchantOrderNostringYmerchant defined transaction ID, must be unique for each request
orderNostringYAlchemy Pay defined transaction ID
currencystringYUSD, EUR, GBP, JPY
orderAmountlongYtransaction amount,
unit in cents (i.e. 100 = $1)
orderFeelongYtransaction fee, unit in cents (i.e. 100 = $1)
payModelstringYeither CREDIT_CARD or DEBIT_CARD
orderStatusstringYtransaction status, please refer to error code
webUrlstringYredirect URL
pagestringNNULL
orderTimelongNtimestamp
finishTimelongN0
remarkstringNerror description from payment gateway
signstringYsignature with RsaUtil.sign method

Request sample

{
  "lastName": "Kn**t",
  "cardExpMonth": "02",
  "cardCcv": "/K9Gj00mc/cY9h9sejgvPg==",
  "productDetail": "purchaseProduct",
  "cardType": "MASTERCARD",
  "sign": "DzBoYc2tGHPBCQR1/zSjE3z+s1kFNos8kGj/C5R4h9pd7eW4/YfWKSaKX1Kz9Csd78NMzqTtPzUpT7EIE83qpD0itrZsMvuefAECew9F7Q+4N3rj4NypdtZcviGGfHnrnzkxBSn6a9ShdoJA13VYL6yHKMlLDxK18lqocXcvHTg=",
  "payModel": "CREDIT_CARD",
  "language": "zh",
  "merchantOrderNo": "PAY202207272790784161",
  "cardNo": "XaOPEITl9+f4Vss6u1QPTK+6ks6BMCIdRAacA1iBD/Q=",
  "customParam": "1001799476114063361",
  "timeStamp": 1658889214901,
  "cardExpYear": "2028",
  "firstName": "Eva",
  "orderAmount": "10000",
  "payType": "INTERNATIONAL_CARD_PAY",
  "userIp": "120.246.11.66",
  "currency": "USD",
  "callbackUrl": "https://apiuat.alchemypay.org/pay/callback/yyh",
  "noticeUrl": "https://rampuat.alchemypay.org/paymentResult",
  "merType": "1",
  "email": "li***[email protected]",
  "merchantNo": "AC202237083"
}

Response sample

{
   "meta":{
      "success":true,
      "code":"0000",
      "message":"Request Success"
   },
   "data":{
       "merchantNo":"AC202237083",
       "merchantOrderNo":"PAY202207272790784161",
       "orderNo":"R08OC0220727012238117504288178",
       "currency":"USD",
       "orderAmount":12100,
       "orderFee":221,
       "payModel":"CREDIT_CARD",
       "orderStatus":"WAIT3D",
       "webUrl":"https://api-gw.sparkpsp.com/v1/Company3dRequest?order_no=R08CH02207270122381906777110710144&type=PL&return_url=https://payment.alchemytech.cc/nh-gateway/toPageResult/R08CH022072701223819067771107&notify_url=https://payment.alchemytech.cc/nh-gateway/spark/callBack",
       "page":null,
       "orderTime":1658827358118,
       "finishTime":0,
       "sign":"RssFfOMWFTX1+CH0sDhhjFhdafTPtAK+/NtdKo9M4oE/eazrSb3rWcXBeEI/J7cSk6COc80/yrbKs7zWt4UAFeYc+4/D05VBEGdEqjPdzF0KUTvm6i339zwroopNdMpWwGLia0wnBjzCXnSVspd+yLNVy8P6dV+X3a65HSzkqs2GNiLp2InRJcSbQXn201bJ9RehO21HscrLBgMO+qPr6n8b9rpt5LPJVrcQZbcuiiaV/23Cg64Zy9WBgF5i3sxG8HPw1PvOYjhBVgblli3etaJt3V7bag1kNIzPaH6PmJwTA5UlZpz2OyyabYOY9BbIjUvRdmSwI+LX8QFUodG10C9FQB/KavFRcY1MiYlSjq1/21/JniX9y54c+GGgw9EirdO4Hv2K+XI66JAOUa7t3enUqO9zWB3fKqr0IcFQiwX8yiyc+oJyNbXx26UIJ+kEK3qVMMMHtnTyZewq5NXQiO+SKGFL2OKfRu0xaP2gh48011GOrRc6Jgy8qGtkmBizS2CdZjEdIBcxtwwAmi8aoDz2AGM2bLw27IN5T5TPH/mbZzs5jnbF5t/qFxDn6p8vW6Yofn6wvEAP+fMrl978DN2N5zlqfYzMN0SyJjQArj/Ygva+IIXsOExPMIRhj2sjJpfZuMg2zX6S7ooc4UuO214L/4lVnSe7jfyEZuCIf5I=",
       "remark":""
   }
}