P2P – transfers
Receiving token for making a transfer (for each operation you must receive and use the original token)
Request
grant_type: "client_credentials" scope: " transfer" client_id: "test" client_secret: "yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG" invoiceID: "000000001" amount: 100 currency: "KZT" terminal: "c36b282f-6819-4d4f-85df-a4bdc8a8f703" postLink: "" failurePostLink: ""
Field | Description |
---|---|
grant_type | authorization type. client_credentials are used for payment processing |
scope | resource |
client_id | Merchant id (can be obtained on the account page, first given when registered) |
client_secret | Merchant's access key (can be obtained on the account page, first given when registered) |
invoiceID | Order number (generated by merchant, must be unique for every new order) |
amount | Order Amount |
currency | Currency |
terminal | Sale point's id (can be obtained on the account page, first given when registered) |
postLink | Optional parameter. Sends postlink in case of success. |
failurePostLink | Optional parameter. Sends postlink in case of failure. |
Response
{
"access_token":"DCEB8O_ZM5U7SO_T_U5EJQ",
"expires_in": 7200,
"refresh_token":"",
"scope":"transfer",
"token_type":"Bearer"
}
Field | Description |
---|---|
access_token | Token for payment processing |
expires_in | Expiry time |
refresh_token | Not used in current type of request |
scope | Resource. In order to process a payment "payment" resouce is used. |
token_type | Type of the token |
Redirection on payment page
You must connect JS-library to the page and call a halyk.pay() method.
- URL TEST: https://test-epay.homebank.kz/payform/payment-api.js
- URL PROD: https://epay.homebank.kz/payform/payment-api.js
You must specify these paramteres in halyk.pay() method
var createPaymentObject = function(auth, invoiceId, amount) { var paymentObject = { invoiceId: "000000001", invoiceIdAlt:"8564546", backLink: "https://example.kz/success.html", failureBackLink: "https://example.kz/failure.html", postLink: "https://example.kz/", failurePostLink: "https://example.kz/order/1123/fail", language: "rus", description: "Оплата в интернет магазине", accountId: "testuser1", terminal: "67e34d63-102f-4bd1-898e-370781d0074d", amount: 100, data: "{\"statement\":{\"name\":\"Arman Ali\",\"invoiceID\":\"80000016\"}}", currency: "KZT", phone: "77777777777", email: "example@example.com" paymentObject.auth = auth; return paymentObject; }; halyk.p2p(createPaymentObject(auth, invoiceId, amount));
Field | Description |
---|---|
invoiceId | Order number. Generated by a merchant, must be unique for every new order |
invoiceIdAlt | additional order number, generated by the merchant, must be unique for each new order, from 6 to 15 digits |
backLink | A link to get back on a shop page when payment is successful |
failureBackLink | A link to get back on a shop page when payment failed |
postLink | Notification of a payment |
failurePostLink | A notification of an unsuccessfull payment. Information will be sent to the address in postLink if no information is present |
language | Language rus/kaz/eng |
description | Order description |
accountId | Optional field. Used when a merchant has a unique id assigned to the client. Receiving a list of saved cards |
terminal | Id of a sale point |
amount | Order amount |
currency | Transaction currency |
phone | Client's phone number optional |
Client's email address optional | |
cardSave | Whether to save card info or not |
auth | Authorization tokenn |
data | Additional field transmitted in the report when filling out |
Postlink
The message would be sent to the URL that is specified in postLink field. If you have not received a postlink, or to check the request from the ePay system, we recommend using the service Transaction status
Response in an event of success:
Response in an event of success:
"id": "00879b4f-374e-4c3d-b48e-7cb3d249e3b0", "amount": 100, "fee": 100, "accountID": "", "currency": "KZT", "email": "parkhomchik@gmail.com", "description": "Оплата в интернет магазине", "reference": "329957092146", "orderID": "1698317548682", "senderCardID": "f8953a37-aed8-240c-e053-1d1a000ae80c", "senderCardPAN": "440563...5096", "senderCardType": "VISA", "senderTransferType": "TYPEPAN", "receiverCardID": "f8953a37-aed9-240c-e053-1d1a000ae80c", "receiverCardPAN": "552204...6736", "receiverCardType": "MasterCard", "receiverTransferType": "TYPEPAN", "intReference": "BE8FC5EA0167B04B", "terminalID": "c36b282f-6819-4d4f-85df-a4bdc8a8f703", "code": 0, "status": "CHARGE"
Transfer by saved cards
The card is saved if you previously passed the cardave: true parameter, the payment was successful and you received CardID in the response.
- To transfer from a saved card to an unsaved one:
- it is necessary to transfer the previously received cardId of the sender to the senderCardId parameter.
- accountId personal identifier of the Client in the Merchant System.
2.To make a transfer from an unsaved card to a saved card:
- it is necessary to transfer the previously received cardId of the sender to the receiverCardId parameter.
- accountId personal identifier of the Client in the Merchant System.