The present API allows to create QR codes for payments via mobile app WayForPay.QR.
The result of request processing is the getting url on image with QR code.
The request with required parameters is to be formed on the side of the merchant and to be transferred by POST method through HTTP protocol to URL https://api.wayforpay.com/api
Requests authentication
For the purposes of confirmation of data validity there should be generated and transferred in the request the HMAC_MD5 control signature using SecretKey of merchant.
The line which subjects to HMAC_MD5 is generated through catenation of parameters merchantAccount, merchantDomainName, orderReference, orderDate, amount, currency, productName[0],
productName[1]..., productName[n], productCount[0], productCount[1],..., productCount[n], productPrice[0], productPrice[1],..., productPrice[n] divided with “;” (semi-column) in coding UTF-8
Parameter | Description | Mandatory |
---|---|---|
transactionType | CREATE_QR | yes |
merchantAccount | Seller’s identifier. This value is to be assigned to You from the side of WayForPay | yes |
merchantAuthType | Authorization type: simpleSignature | no |
merchantDomainName | Domain name of the merchant’s web-site | yes |
merchantSignature | Signing of the request | yes |
apiVersion |
| yes |
serviceUrl | URL to which the system should sent notification with the result of payment of invoice directly to the merchant | no |
orderReference | Unique number of invoice in the merchant’s system | yes |
orderDate | Date of order placing | yes |
amount | Amount to be paid | yes |
currency | Currency of order UAH | yes |
alternativeAmount | Alternative amount of order | no |
alternativeCurrency | Alternative currency of order USD, EUR | no |
orderTimeout | Sets the active time of invoice during which the client may try to pay it. On default the invoice is available for payment within 1 hour | no |
productName[] | Array with the names of ordered products | yes |
productPrice[] | Array with the prices per product unit. This information will be visible at the page of order payment | yes |
productCount[] | Array with the quantity of ordered goods by each item. | да |
clientFirstName | Client name (minimal length 1 symbol) | no |
clientLastName | Client surname (minimal length 1 symbol) | no |
clientEmail | Client Email | no |
clientPhone | Client’s phone number | no |
Response parameters:
reason | Reason for refusal | |
reasonCode | Code of refusal | |
imageUrl |
An example of request and response
Request:
{
"TRANSACTIONTYPE":"CREATE_QR",
"MERCHANTACCOUNT":"TEST_MERCH_N1",
"MERCHANTAUTHTYPE":"SIMPLESIGNATURE",
"MERCHANTDOMAINNAME":"WWW.SUPER.ORG",
"MERCHANTSIGNATURE":"60C5D743B71F79ABE48C7183ADA4B451",
"APIVERSION":1,
"SERVICEURL":”HTTP://SERVICEURL.COM”,
"ORDERREFERENCE":"MYORDER1",
"ORDERDATE":1421412898 ,
"AMOUNT":1547.36,
"CURRENCY":"UAH",
"ORDERTIMEOUT": 86400,
"PRODUCTNAME":["SAMSUNG WB1100F","SAMSUNG GALAXY TAB 4 7.0 8GB 3G BLACK"],
"PRODUCTPRICE":[21.1,30.99],
"PRODUCTCOUNT":[1,2],
"CLIENTFIRSTNAME":"BULBA",
"CLIENTLASTNAME":"TARAS",
"CLIENTEMAIL":"ROB@MAIL.COM",
"CLIENTPHONE":"380556667788"
}
Response:
{
"REASON":"1100",
"REASONCODE":"OK",
"INVOICEURL":"HTTPS://SECURE.WAYFORPAY.COM/PAY/5534EB845B744D27B3CA57EB38A74599&SIGN=A4A923EDD74F9B23BDD8922B4A2D8630",
}
Notification of merchant about the status of QR payment transaction
For authorized and checked orders (as well as in case of change of order status) WayForPay server sends to serviceUrl a request (HTTP_POST) which includes the order data.
This information is to be supplemented with a control signature HMAC_MD5.
In case if WayForPay WILL NOT obtain correct response from the merchant’s server the system will sent the requests during 4 days or until obtaining of correct response.
Parameters of request of WayForPay gate to serviceUrl
For the purposes of confirmation of data validity there should be generated and transferred in the request the HMAC_MD5 control signature using SecretKey of merchant.
The line which subjects to HMAC_MD5 is generated through catenation of parameters merchantAccount, orderReference, amount, currency, authCode, cardPan, transactionStatus, reasonCode divided with “;” (semi-column) in coding UTF-8
Parameter | Description | Mandatory |
---|---|---|
merchantAccount | Seller’s identifier | test_merchant |
orderReference | Unique number of invoice in the merchant’s system | 1212dd1 |
merchantSignature | hash_hmac |
|
amount | Amount of order | 100 |
currency | Currency of order | UAH |
authCode | authorization code - assigned by Bank | 324567 |
| payer email | |
phone | Phone number of the payer | +38063-333-33-33 |
createdDate | Date of creation request in psp | 123456789 |
processingDate | Date of transaction processing | 12345678 |
cardPan | Masked card number | 42****4242 |
cardType | Card type: Visa/MasterCard | Visa |
issuerBankCountry | Country of card | Ukraine |
issuerBankName | Name of the Bank card | PrivatBank |
recToken | card token for recurring payments | 121213321-3213213-3213213-321-3 |
transactionStatus | transaction status | Approved |
reason | Reason for refusal | Ok |
reasonCode | Code of refusa | 1100 |
fee | Commission psp | 0.00 |
paymentSystem | The payment system, through which the payment was made. | card |
An example of request on serviceUrl
{
"MERCHANTACCOUNT":"TEST_MERCH_N1",
"ORDERREFERENCE":"MYORDER1 ",
"MERCHANTSIGNATURE":"",
"AMOUNT":"1547.36",
"CURRENCY":"UAH",
"AUTHCODE":"541963",
"EMAIL":"CLIENT@MAIL.UA",
"PHONE":"380501234567",
"CREATEDDATE":"",
"PROCESSINGDATE":"",
"CARDPAN":"4102****8217",
"CARDTYPE":"VISA",
"ISSUERBANKCOUNTRY":"980",
"ISSUERBANKNAME":"PRIVATBANK",
"RECTOKEN":"",
"TRANSACTIONSTATUS":"APPROVED",
"REASON":"1100",
"REASONCODE":"",
"FEE":"",
"PAYMENTSYSTEM":"CARD"
}
Example of correct response from the merchant
WayForPay system expects to obtain from the merchant’s server the following response:
{
"ORDERREFERENCE":"DH783023",
"STATUS":"ACCEPT",
"TIME":1415379863,
"SIGNATURE":""
}
For the purposes of confirmation of data validity there should be generated and transferred in the request the HMAC_MD5 control signature using SecretKey of merchant.
The line which subjects to HMAC_MD5 is generated through catenation of parameters orderReference, status, time divided with “;” (semi-column) in coding UTF-8