API Docs – Union Pay Solution (QR)
API DOCS
Paywiser Integration Guide
Union Pay Solution (QR)
Payment
To process a transaction using Rest API end point, the data can be send using GET POST to https://merchant.paywiser.com/api/api.php/{sid}/singletx. Replace {sid} with the sid being used to send transaction to.The result of the transaction will be send as a json repsone and a post to the postback_url
Payment Parameters
Name | Required (Yes or No) | Description |
---|---|---|
sid | YES | Site id (unique identifier for the web site) |
tid | NO | Tracking id (must be unique for each transaction) |
postback_url | YES | The URL of the page used to recieve the TxHandler postback. The response can be read from $_POST array. |
hash | YES | md5 hash of sid+timestamp+amounttotal+currency+rcode ie: md5(’22’.’1234568995265421′.’17.00′.’CNY’.’222b6c’) REMARK : amounttotal = (item_amount_unit[] * item_quantity ) + amount_shipping + amount_tax – amount_coupon |
timestamp | YES | ie: 1234568995265421 |
card_type | YES | qrpay |
firstname | YES | Frist name of the customer |
lastname | YES | Last name of the customer |
phone | YES | 10 to 14 numeric digits |
YES | ||
mobile | NO | Mobile number |
address | NO | Customer address |
suburb_city | NO | Customer suburb or city |
state | NO | Customer state, 2 digit code for US/Canada |
postcode | NO | Customer postcode/zipcode |
country | NO | Customer country, ISO 3166 2 digit code |
currency | YES | Transaction currency[currency in which the gateway is setup], ISO 3 letter code ie : CNY |
amount_shipping | YES | Transaction shipping amount. 0.00 if nothing |
amount_coupon | YES | Coupon amount. 0.00 if nothing |
amount_tax | YES | Transaction shipping amount. 0.00 if nothing |
item_quantity[] | YES | Quantity of each cart item |
item_name[] | YES | Article names for each cart item |
item_no[] | YES | Descriptions for each cart item |
item_desc[] | YES | Descriptions for each cart item |
item_amount_unit[] | YES | Price per unit for each cart item in two decimal place |
ref1 | NO | Merchant reference field |
ref2 | NO | Merchant reference field |
ref2 | NO | Merchant reference field |
ref3 | NO | Merchant reference field |
ref4 | NO | Merchant reference field |
tx_action | NO | PREAUTH |
Response
There will be two responses one with tx_action =PREAUTH and another withtx_action = SETTLEMENT. The transaction is completed when you receive the response with tx_action=SETTLEMENT. The response will have the parameters as below
Name | Required (Yes or No) | Description |
---|---|---|
sid | String | Has the sid where transaction was processed |
status | String | Has the value “OK” for a successful transaction, or “EXC” for a failed transaction. |
parent_txid | String | Parent transaction id |
txid | String | The transaction ID |
tx_action | String | The state change txaction, e.g. “PREAUTH” or “SETTLEMENT” |
amount | String | The amount processed. |
currency | String | The currency in which the transaction was processed |
comment | String | Response from the gateway |
descriptor | String | Gateway descriptor name |
tid | String | From the original transaction |
ref1 | String | From the original transaction |
ref2 | String | From the original transaction |
ref3 | String | From the original transaction |
ref4 | String | From the original transaction |
vrfy | String | This is a sha 256 hash so the data can be verified. To generate hash with sha256 the string of sid;rcode;txid;status;amount;currency;tx_action |
error | If an error has occurred, then the status value will equal “EXC” and these parameters will be sent as well. Detailed error will be present only if we receive it from the processing gateway. | |
error_type | String | error_type |
error_sys | String | The system that caused the error (client or server) |
error_msg | String | The error message |
error_info | String | Error information that contains the bank message and bank code |
error_code | String | error_code |
Sample Form
POST /api/api.php/61/singletx?
sid=61&hash=3af0dc9167a92e0334cf64e21c63d7f5×tamp=1234567 &postbac
k_url=http://merchant.paywiser.com/postbackreturn.php&amount_shipping=0.00&amo
unt_tax=0.00&amount_coupon=0.00&card_type=qrpay&item_quantity[]=1&ite m_name[]=1
68C8699&item_no[]=168C8699&item_desc[]=2324343443&item_amount_unit[]=31.10&
currency=CNY&email=test@gmail.com&ref1=123test HTTP/1.1
Host: merchant.paywiser.com
Content-Type: application/x-www-form-urlencoded