API Explanation

Request Type

POST

Request URI

/api/v1/pay/unionpay/web-secure-pay

Request

Parameter Type Required Description Remark
amount String Yes Transaction Amount cent is the unit, “100” means a dollar
callbackURL String Yes Callback URL Send notifications to this URL when an order is complete (Maximum length 255 English characters)
returnURL String Yes Return URL After the payment is completed, will navigate to this URL (Maximum length 255 English characters)
remark String No Remark Remark(Maximum length with 128 English characters)

Request Example:

{
  "amount": "1000",
  "callbackURL": "https://your.callback.url",
  "returnURL": "https://your.return.url",
  "remark": ""
}

Response

Parameter Type Description Remark
form String HTML format Form code For front-end embed and let users start the payment
paymentId String Payment ID

Response Example:

{
  "status": "SUCCESS",
  "result": {
    "form": "<form id = \"pay_form\" action=\"https://gateway.95516.com/gateway/api/frontTransReq.do\" method=\"post\"><input type=\"hidden\" name=\"bizType\" id=\"bizType\" value=\"000201\"/><input type=\"hidden\" name=\"txnSubType\" id=\"txnSubType\" value=\"01\"/><input type=\"hidden\" name=\"orderId\" id=\"orderId\" value=\"1677702123950651\"/><input type=\"hidden\" name=\"backUrl\" id=\"backUrl\" value=\"https://uat-scanpay.ottpay.com/upopcallback\"/><input type=\"hidden\" name=\"signature\" id=\"signature\" value=\"nvEsixVMHU6ZUbVVRxm9ddBVeqJxJj1u/P2IIk53Qn2SgM4XzSqjYySDH7qFjwW8iOr+DXqEF1iyrPc+AFm0jESU8wuOG+T1ZJL0hr5FMGScjI0KnEi+O2LFZUhT9cCU3CS3idenwB4lCL4s0hPeAiU6rE3o3kNQvPb4UBYaZMmc5uQTLScsibt06eKjFUfIBELKAIFyOftoow3nUj3ax50ITWnxtQbe2DfarITDy6lA60CznZzdp9YRzTKgzS91oM6xdLDupzr3aAmkAmEfUY/MaaFBrLgZQSPCugz+TiXUBrzNkli73REM+2hcIhQi+3Na3SACw+4814IvMa/R8w==\"/><input type=\"hidden\" name=\"merName\" id=\"merName\" value=\"(OTTITTT Test)GCwebappONLMarkham     CAN\"/><input type=\"hidden\" name=\"txnType\" id=\"txnType\" value=\"01\"/><input type=\"hidden\" name=\"channelType\" id=\"channelType\" value=\"07\"/><input type=\"hidden\" name=\"frontUrl\" id=\"frontUrl\" value=\"https://www.example.ca\"/><input type=\"hidden\" name=\"certId\" id=\"certId\" value=\"79513944402\"/><input type=\"hidden\" name=\"encoding\" id=\"encoding\" value=\"UTF-8\"/><input type=\"hidden\" name=\"acqInsCode\" id=\"acqInsCode\" value=\"41390124\"/><input type=\"hidden\" name=\"version\" id=\"version\" value=\"5.1.0\"/><input type=\"hidden\" name=\"merAbbr\" id=\"merAbbr\" value=\"(OTTITT\"/><input type=\"hidden\" name=\"accessType\" id=\"accessType\" value=\"1\"/><input type=\"hidden\" name=\"reserved\" id=\"reserved\" value=\"{eci=09&pageLanguage=en_US&cardNumberLock=1}\"/><input type=\"hidden\" name=\"txnTime\" id=\"txnTime\" value=\"20230302042204\"/><input type=\"hidden\" name=\"merId\" id=\"merId\" value=\"797800000185001\"/><input type=\"hidden\" name=\"merCatCode\" id=\"merCatCode\" value=\"5944\"/><input type=\"hidden\" name=\"accType\" id=\"accType\" value=\"01\"/><input type=\"hidden\" name=\"payTimeout\" id=\"payTimeout\" value=\"20230302043704\"/><input type=\"hidden\" name=\"currencyCode\" id=\"currencyCode\" value=\"124\"/><input type=\"hidden\" name=\"signMethod\" id=\"signMethod\" value=\"01\"/><input type=\"hidden\" name=\"txnAmt\" id=\"txnAmt\" value=\"1000\"/></form><script type=\"text/javascript\">document.all.pay_form.submit();</script>",
    "paymentId": "1677702123950651"
  }
}

Payment Result

After the OTT Pay API server obtains the payment result from the payment channel, it will immediately send the payment result to the specified callbackURL. Of course, the merchant system can also actively query through Payment Status Query API.