Web Acquiring Documentation
KhanPay processing center. Developer's Guide
Introduction
Following instruction explains how to make full cycle of payment acquiring:
Steps to start implementation
Using your point id and provided certificate you have to make api POST request to the backend:
1. Make a request to get uui
The data formats used are shown in Table 1
Table 1 - Data formats used
Format | Description |
---|---|
intN | N-byte integer |
numeric(N,M) | Fractional, N - number of characters, M - number of characters of the fractional part. The separator of the fractional and integer parts is a dot |
varchar(N) | String, not exceeding N bytes in length. All strings are transmitted in UTF-8 encoding |
Boolean | Boolean, valid values are true, false |
Time | A data type that stores date and time in the format YYYY-MM-DD-Thh:mm:ss[+|-]HHMI, where: 1. YYYY is the year written in 4 digits; 2. MM—month with leading zero; 3. DD - day of the month; 4. T - separator; 5. hh — number of hours in 24-hour format with leading zero; 6. mm — number of minutes with leading zero; 7. ss — number of seconds with a leading zero; 8. [+|-]HHMI - time zone. |
The structure of the <advanced>
element is shown in Table 2
Table 2 — Structure of the <advanced>
element
Title | Type | Format | Req. | Description |
---|---|---|---|---|
service | Attribute | int4 | Yes | Service number |
function | Attribute | varchar100 | Yes | Reserved function name auth-acquiring which processes authentication and gives UUID |
The structure of the <attribute>
element is shown in Table 3
Table 3 - Structure of the <attribute>
element
Title | Type | Format | Req. | Description |
---|---|---|---|---|
name | Attribute | varchar50 | Yes | Attribute name |
value | Attribute | varchar100 | Yes | Attribute value |
REQUEST:
<?xml version="1.0" encoding="UTF-8"?>
<request point="4306">
<advanced service="1185" function="auth-acquiring" >
<attribute name="amount" value="3"/>
<attribute name="currency" value="USD"/>
<attribute name="billing_fullname" value="John Doe"/>
<attribute name="billing_address" value="1 Main Street"/>
<attribute name="billing_city" value="New York"/>
<attribute name="billing_state" value="NY"/>
<attribute name="billing_zipcode" value="123456"/>
<attribute name="billing_country" value="USA"/>
<attribute name="redirect_url" value="https://abc.com/redirect?param=1432sadf"/>
<attribute name="notify_url" value="https://api.abc.com/notify"/>
</advanced>
</request>
RESPONSE IN CASE OF SUCCESS:
<response>
<result code="0" service="0">
<data>
<input key="auth-token" keyTitle="Authorization Token" value="a7dc5879-35b4-466e-bd10-0a1d0228a4f9" valueTitle="a7dc5879-35b4-466e-bd10-0a1d0228a4f9" flags="0"/>
<input key="pay-url" keyTitle="Payment URL" value="https://auth.khanpay.kz/pay-form/a7dc5879-35b4-466e-bd10-0a1d0228a4f9" valueTitle="a7dc5879-35b4-466e-bd10-0a1d0228a4f9" flags="0"/>
</data>
</result>
</response>
RESPONSE IN CASE OF ERROR:
<response>
<result code="0" service="6"></result>
</response>
<response>
<result code="0" service="4"></result>
</response>
2. Proceed Acquiring on Web UI
Following Web UI page will appear when open url coming from previous request:
EXAMPLE:
<response>
<result code="0" service="0">
<data>
<input key="auth-token" keyTitle="Authorization Token" value="a7dc5879-35b4-466e-bd10-0a1d0228a4f9" valueTitle="a7dc5879-35b4-466e-bd10-0a1d0228a4f9" flags="0"/>
<input key="pay-url" keyTitle="Payment URL" value="https://auth.khanpay.kz/pay-form/a7dc5879-35b4-466e-bd10-0a1d0228a4f9" valueTitle="a7dc5879-35b4-466e-bd10-0a1d0228a4f9" flags="0"/>
</data>
</result>
</response>
By pressing “Deposit” system will start processing payment
when payment is done, page will be redirected to url which is passed on step 1
redirect_url
and also system will notify webhook to url which is passed on step 1
notify_url
with all information of transaction