The present API allows to perform replenishment of the cards of natural persons from the banking account TSC. Replenishment is possible for any cards issued by Ukrainian banks.
Two alternatives of replenishment processing are provided in the system:
- replenishment by the card number
- replenishment using token
Replenishment by the card number is to be performed in one action. TSC may transfer in the request the card number or previously obtained token. If both parameters were transferred the error of request processing will arise.
The procedure of assets crediting on card - immediately, there are possible cases when the assets are credited within the day – it depends upon the internal procedure of assets crediting by the issuing Bank that issued such card.
To check the card validity and its status it is recommended to use the type of request Verify.
Request parameters
The request with required parameters is to be formed on the side of merchant and to be transferred by POST method through HTTP protocol to URL https://api.wayforpay.com/api
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, cardBeneficiary, rec2Token divided with “;” (semi-column) in coding UTF-8
Parameter | Description | Mandatory |
transactionType | Transaction type, It takes the value P2P_CREDIT | yes |
merchantAccount | Unieque Seller’s identifier | yes |
merchantAuthType | Authorization type: simpleSignature (default) | no |
orderReference | Unique number of the order in merchant’s system | yes |
amount | Amount of transfer | yes |
currency | Currency of transfer: UAH | yes |
cardBeneficiary | Card number of recipient | yes |
rec2Token | Recipient card token | yes |
merchantSignature | Signature of the request | yes |
apiVersion | The protocol version. Default value: 1 | yes |
serviceUrl | URL to which the system should sent notification with the result of payment of invoice directly to the merchant | no |
recipientFirstName | Recipient FirstName | no |
recipientLastName | Recipient LastName | no |
recipientPhone | Recipient phone | no |
recipientEmail | Recipient E-mail | no |
Response parameters
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, transactionStatus, reasonCode divided with “;” (semi-column) in coding UTF-8
Parameter | Description | Example |
merchantAccount | Seller’s identifier | test_merchant |
orderReference | Unique number of the order in merchant’s system | 1212dd1 |
merchantSignature | hash_hmac |
|
amount | Amount of order | 100 |
currency | Currency of order | UAH |
authCode | Authorization code - assigned by Bank | 324567 |
cardPan | Masked card number номер карты | 42****4242 |
cardType | Nbng rfhns: Visa/MasterCard | Visa |
issuerBankName | Name of the Bank card | PrivatBank |
createdDate | Date of creation request in psp (UTC) | 123456789 |
processingDate | date of transaction processing (UTC) | 12345678 |
transactionStatus | transaction status | Approved |
reason | Reason for refusal | Ok |
reasonCode | Code of refusal | 1100 |
An example of request and response
{
"transactionType":"P2P_CREDIT",
"merchantAccount":"p2p_credit",
"merchantAuthType":"SimpleSignature",
"merchantSignature":"60c5d743b71f79abe48c7183ada4b451",
"apiVersion":1,
"orderReference":"myOrder1",
"amount":10.13,
"currency":"UAH",
"cardBeneficiary":"4111111111111111"
}
{
"merchantAccount": "p2p_credit",
"orderReference": "myOrder1",
"merchantSignature":"b95932786cbe243a76b014846b63fe92",
"amount": 10.13,
"currency": "UAH",
"authCode": "221562",
"createdDate": 1415379863,
"processingDate": 1415379863,
"transactionStatus": "Approved",
"reason": "ok",
"reasonCode": 1100
}