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: ""

FieldDescription
grant_typeauthorization type. client_credentials are used for payment processing
scoperesource
client_idMerchant id (can be obtained on the account page, first given when registered)
client_secretMerchant's access key (can be obtained on the account page, first given when registered)
invoiceIDOrder number (generated by merchant, must be unique for every new order)
amountOrder Amount
currencyCurrency
terminalSale point's id (can be obtained on the account page, first given when registered)
postLinkOptional parameter. Sends postlink in case of success.
failurePostLinkOptional parameter. Sends postlink in case of failure.

Response

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

FieldDescription
access_tokenToken for payment processing
expires_inExpiry time
refresh_tokenNot used in current type of request
scopeResource. In order to process a payment "payment" resouce is used.
token_typeType of the token

Redirection on payment page

You must connect JS-library to the page and call a halyk.pay() method.

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));

FieldDescription
invoiceIdOrder number. Generated by a merchant, must be unique for every new order
invoiceIdAltadditional order number, generated by the merchant, must be unique for each new order, from 6 to 15 digits
backLinkA link to get back on a shop page when payment is successful
failureBackLinkA link to get back on a shop page when payment failed
postLinkNotification of a payment
failurePostLinkA notification of an unsuccessfull payment. Information will be sent to the address in postLink if no information is present
languageLanguage rus/kaz/eng
descriptionOrder description
accountIdOptional field. Used when a merchant has a unique id assigned to the client. Receiving a list of saved cards
terminalId of a sale point
amountOrder amount
currencyTransaction currency
phoneClient's phone number optional
emailClient's email address optional
cardSaveWhether to save card info or not
authAuthorization tokenn
dataAdditional 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.

  1. 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.

sender 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.

receiver