Installment, Credit
When registred, you will be given credentials that you would need for making payments:
TerminalID | Store Identification |
ClientID | Client Identificator |
ClientSecret | Secret Keys |
Test merchant
url | https://test-epay.homebank.kz |
epay@halykbank.kz | |
password | XZG1E@Mm |
ClientID | test |
ClientSecret | yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG |
TerminalID | 67e34d63-102f-4bd1-898e-370781d0074d |
Receiving a token for payment processing (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: "payment" client_id: "test" client_secret: "yF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG" invoiceID: "000000001" amount: 100 currency: "KZT" terminal: "67e34d63-102f-4bd1-898e-370781d0074d" 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":" webapi usermanagement email_send verification statement statistics payment",
"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. Ресурс, для проведения платежа используется ресурс payment |
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: https://test-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", backLink: "https://example.kz/success.html", failureBackLink: "https://example.kz/failure.html", postLink: "https://example.kz/", failurePostLink: "https://example.kz/order/1123/fail", language: "RU", description: "Оплата в интернет магазине", accountId: "testuser1", terminal: "67e34d63-102f-4bd1-898e-370781d0074d", amount: 100, currency: "KZT", phone: "77777777777", email: "example@example.com" cardSave: "true" }; 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 | 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 |
description | Order description |
accountId | Optional field. Used when a merchant has a unique id assigned to the client |
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 |
creditConditions | Array of numbers [3,6,9], months |
installmentConditions | Array of numbers [3,6,9], months |
defaultCredit | true- the controller displays the first tab, credit and installments |
auth | The token / is transmitted completely as an object, all data received from epay at the request of the token |
data | The additional field is translated in the report when filled in, the statement parameter is mandatory |
Post link
A message will be sent to the specified URL specified in the post Link field. If you have not received a postlink, we recommend using the Transaction Status service Transaction status.
Response in an event of success:
{ "id": "ffffffff-0000-000f-f000-00f0000f000f", "dateTime": "2020-01-01T00:00:00.00000+06:00", "invoiceId": "10000000001", "amount": 100, "currency": "KZT", "terminal": "999999999", "accountId": "1", "description": "Оплата в интернет магазине", "language": "RU", "cardMask": "4444...4444", "cardType": "", "issuer": "Halyk bank", "reference": "001111111111", "secure": "yes", "tokenRecipient": "", "code": "ok", "reason": "", "reasonCode": 0, "name": "CARD HOLDER", "email": "ch@example.kz", "phone": "77777777777", "ip": "5.188.155.135", "ipCountry": "Kazakhstan", "ipCity": "Almaty", "ipRegion": "", "ipDistrict": "", "ipLongitude": 76.9293, "ipLatitude": 43.2638, "cardID": "e7e2587f-de26-4f41-ae1f-80c1fea31728" }
Response in an event of a failure:
{
"id": "ffffffff-0000-000f-f000-00f0000f000f",
"dateTime": "2020-01-01T00:00:00.00000+06:00",
"invoiceId": "10000000001",
"amount": 100,
"currency": "KZT",
"terminal": "999999999",
"accountId": "1",
"description": "Оплата в интернет магазине",
"language": "RU",
"cardMask": "4444...4444",
"cardType": "",
"issuer": "Halyk bank",
"reference": "",
"secure": "yes",
"tokenRecipient": "",
"code": "error",
"reason": "описание ошибки",
"reasonCode": -498,
"name": "CARD HOLDER",
"email": "ch@example.kz",
"phone": "77777777777",
"ip": "5.188.155.135",
"ipCountry": "Kazakhstan",
"ipCity": "Almaty",
"ipRegion": "",
"ipDistrict": "",
"ipLongitude": 76.9293,
"ipLatitude": 43.2638
}