Withdrawal request
Before making real payments, the merchant must be informed of the corporate card (IBAN account number) and the TerminalID number for registration in the system. The request must be sent to dev.epay@halykbank .kz
During registration, you will be given the data that you will need to use when making the payment:
TerminalID | Store ID |
ClientID | Client ID |
ClientSecret | Secret key |
Test merchant
url | https://test-epay.homebank.kz |
epay@halykbank.kz | |
password | XZG1E@Mm |
ClientID | test |
ClientSecret | yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG |
TerminalID | c36b282f-6819-4d4f-85df-a4bdc8a8f703 |
Test payment card
PAN | Expire Date | CVC | Status |
---|---|---|---|
4405639704015096 | 01/25 | 815 | unlock |
5522042705066736 | 01/25 | 525 | unlock |
377514500000794 | 09/23 | 1687 | unlock |
4003032704547597 | 09/20 | 170 | lock |
5578342710750560 | 09/20 | 254 | lock |
Getting a token to make a payment (for each operation, you must receive and use the original token)
TEST URL POST https://testoauth.homebank.kz/epay2/oauth2/token PROD URL POST https://epay-oauth.homebank.kz/oauth2/token
Request
Body: form-data
grant_type: "client_credentials" scope: " webapi usermanagement email_send verification statement statistics payment" 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 type is used for making a payment |
scope | Resource |
client_id | Merchant ID, can be obtained in the cabinet, issued during registration |
client_secret | The merchant's access key, which can be obtained in the cabinet, is issued upon registration |
invoiceID | The order number generated by the merchant must be unique for each new order, from 6 to 15 digits. If your order number contains more than 6 characters, then additionally uniqueness must be observed for the last 6 characters |
amount | Order amount |
currency | Currency |
terminal | The ID of the point of sale, which can be obtained in the cabinet, is issued during registration |
postLink | Required parameters, sending postlink if successful |
failurePostLink | Optional parameters, sending a postlink in case of failure |
Response
{
"access_token":"DCEB8O_ZM5U7SO_T_U5EJQ",
"expires_in": 7200,
"refresh_token":"",
"scope":" webapi usermanagement email_send verification statement statistics payment",
"token_type":"Bearer"
}
Field | Description |
---|---|
access_token | Token for the operation |
expires_in | Token expiration time |
refresh_token | Not used for this type of authorization |
scope | Resource, a resource is used for making a payment |
token_type | Authorization type |
Redirection to the withdrawal page
On the page you need to connect the JS library and call the halyk.oct() method in it.
URL TEST: https://test-epay.homebank.kz/payform/payment-api.js URL PROD: https://epay.homebank.kz/payform/payment-api.js
The following parameters must be passed to the halyk.oct() method.
var createPaymentObject = function(auth, invoiceId, amount) { var paymentObject = { InvoiceID: "000000001", 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: "Payment in an online store", AccountId: "testuser1", terminal: "c36b282f-6819-4d4f-85df-a4bdc8a8f703", amount: 100, data: "{\"statement\":{\"name\":\"Arman Ali\",\"invoiceID\":\"80000016\"}}", currency: "KZT", phone: "77777777777", email: "example@example.com" paymentObject.auth = auth; return paymentObject; }; halyk.pay(createPaymentObject(auth, invoiceId, amount));
Field | Description |
---|---|
invoiceId | The order number generated by the merchant must be unique for each new order, from 6 to 15 digits. If your order number contains more than 6 characters, then additionally uniqueness must be observed for the last 6 characters |
backLink | Link to return to the store with a successful payment |
failureBackLink | Link to return to the store in case of a failed payment |
postLink | Payment Notification |
failurePostLink | Notification of a failed payment, if not filled in, the information will be sent to the address specified in the postLink |
language | Language rus/kaz/eng |
description | Order description, allowed number of characters 125 bytes |
accountId | Optional field for specifying the store's customer ID |
terminal | Store ID |
amount | Order amount |
currency | Currency |
phone | Customer's phone number (optional) |
Client email (optional) | |
auth | Token / is transmitted completely as an object, all data received from epay at the request of the token |
data | Additional field is translated in the report when filling in (optional) |
Postlink
A message will be sent to the specified URL specified in the postLink field. If you have not received a postlink, we recommend using the [Transaction Status] service (https://epayment.kz/ru/docs/P2P-CHECK-STATUS-BY%20TERMID ).
Response if successful:
``json { "id": "3e215f23-8378-4a22-c33b-324sd2c3f5", "amount": 100, "accountID": "epayment.KZ", "currency": "KZT", "email": "email@gmail.com", "description": "TEST p2p", "reference": "306177717717", "invoiceID": "000000001", "intReference": "", "terminalID": "c36b282f-6819-4d4f-85df-a4bdc8a8f703", "senderCardID": "", "senderCardPAN": "440563...11111", "senderCardType": "VISA", "senderTransferType": "TYPEPAN", "senderCardIssuer": "HALYK BANK", "receiverCardID": "", "receiverCardPAN": "400303...0011", "receiverCardType": "VISA", "receiverTransferType": "TYPEPAN", "receiverCardIssuer": "HALYK BANK", "secure": false, "reason": "Successfully completed", "reasonCode": "00", "name": " ", "phone": "", "datetime": "2023-03-02T10:33:26.11129789+06:00", "status": "ok", "data": "", "post_link": "https://epay.homebank.kz/payform", "failure_post_link": "https://testmerchant/order/000000001/fail", "p2pType": "OCT" }
[Response Codes](https://epayment.kz/ru/docs/kody-oshibok ) ### Response in case of failure: ```json { "id": "3e215f23-8378-4a22-c33b-324sd2c3f5", "amount": 10, "accountID": "epayment.KZ", "currency": "KZT", "email": "email@gmail.com", "description": "TEST p2p", "reference": "306177717717", "invoiceID": "000000001", "intReference": "", "terminalID": "c36b282f-6819-4d4f-85df-a4bdc8a8f703", "senderCardID": "", "senderCardPAN": "", "senderCardType": "", "senderTransferType": "", "senderCardIssuer": "", "receiverCardID": "", "receiverCardPAN": "", "receiverCardType": "", "receiverTransferType": "", "receiverCardIssuer": "", "secure": false, "reason": "Restricted card", "reasonCode": "489", "name": "", "phone": "", "datetime": "2023-03-02T14:50:36.397155787+06:00", "status": "error", "data": "", "post_link": "https://epay.homebank.kz/payform", "failure_post_link": "https://testmerchant/order/000000001/fail", "p2pType": "OCT" }