Saved card based payment

When registered, you will be given data, that is needed when making the payment:

TerminalIDStore identification
ClientIDClient Identification
ClientSecretSecret Key

The card is saved if you previously passed the cardsave: true parameter, the payment was successful and you received CardID in the response

Receiving a token for payment processing (for each operation it is necessary to obtain 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: ""

FieldDescription
grant_typeAuthorization type, client_credentials used to process payment
scopeResource
client_idMerchand Identification, сan be retrieved on the merchant account page, initially received when registering
client_secretMerchant access key, сan be retrieved on the merchant account page, initially received when registering.
invoiceIDThe 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 additional uniqueness must be maintained in the last 6 characters
amountOrder amount
currencyOrder currency
terminalSalespoint identification, сan be retrieved on the merchant account page, initially generated when registered.
postLinkOptional parameter. Sends postLink in case of success
failurePostLinkOptional parameter. Sends failurePostLink in case of failure

Response

{
  "access_token":"DCEB8O_ZM5U7SO_T_U5EJQ",
  "expires_in": 7200,
  "refresh_token":"",
  "scope":"payment",
  "token_type":"Bearer"
}

FieldDescription
access_tokenA token that is used for payment processing.
expires_inExpiry period of a token
refresh_tokenNot used with this type of authorization
scopeResource, payment type used for payment authorization
token_typeuthorization type

Payment processing

In order to process payment with cardID, paymentType = cardId parameter is required.

Incoming parameters on payment page

FieldDescriptionRequired
invoiceIdThe 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 additional uniqueness must be maintained in the last 6 charactersYes
backLinkLink to return the buyer to the store (website) after successful paymentYes
failureBackLinkLink to return the buyer to the store (website) after payment in case of unsuccessful paymentNo
postLinkA link to send a notification about the authorization of a paymentYes
failurePostLinkA link to send a notification about the failed authorization of payment or store errorNo
languageInformation about authorization sever's interface language kaz, rus, engNo
descriptionThis field conveys information about the goods or services for which payment is made, the allowed number of characters is 125 bytesYes
accountIdPersonal id of a client in Merchants systemNo
terminalIdTerminal number for paymentYes
amountTransaction amountYes
currencyTransaction currencyYes
tokenAuthorization tokenYes
paymentTypepayment type - cardIdYes
cardidCard tokenYes

TEST URL POST https://testepay.homebank.kz/api/payments/cards/auth POST URL /payments/cards/auth Authorize: bearer KJHKJH8&5F&D3&F

Request

Headres: 
Authorization: bearer KJHKJH8&5F&D3&F

Body:
{
   "amount":100,
   "currency":"KZT",
   "name":"TEST TEST",
   "terminalId":"67e34d63-102f-4bd1-898e-370781d0074d",
   "invoiceId":"10101112",
   "invoiceIdAlt":"8564546",
   "description":"test",
   "accountId":"uuid000001",
   "email":"parkhomchik@gmail.com",
   "phone":"77472261170",
   "backLink":"https://testmerchant/order/1123",
   "failureBackLink":"https://testmerchant/order/1123/fail",
   "postLink":"https://testmerchant/order/1123",
   "failurePostLink":"https://testmerchant/order/1123/fail",
   "language":"rus",
   "paymentType":"cardId",
   "cardId":{
      "id":"e7e2587f-de26-4f41-ae1f-80c1fea31728" //значение полученного ранее cardID, при первичной оплате
   }
}

Response

In case of success 
HTTP Code 200


{
  "id": "75890cc5-157a-4cce-9624-16b227c2b9ec",
  "accountId": "",
  "amount": 100,
  "amountBonus": 0,
  "currency": "KZT",
  "description": "payment",
  "email": "test@example.com",
  "invoiceID": "9999999",
  "invoiceIdAlt":"8564546",
  "language": "RU",
  "phone": "77777777777",
  "reference": "099467918563",
  "intReference": "C3B673466V9600X3",
  "secure3D": null,
  "cardID": "22f2c5db-64d8-475f-8066-af3de3dc8233",
  "code": 0,
  "status": "AUTH",
}

In case of error HTTP Code 4xx

{
    "code": -1,
    "message": "error message"
}