Wiki-статья. Потребительское кредитование

Contents

Loan API URL

Loan transactions are initiated through HTTPS POST request by using URL in the following format:

https://PAYNETEASY_SERVER/paynet/api/v2/loan/ENDPOINTID

Endpoint is an entry point for incoming Merchant's transactions and is actually the only PaynetEasy object which is exposed via API. Merchant sends HTTPS requests to the appropriate URL in order to process transactions.

Loan Transaction Flow

  1. Merchant initiates a transaction by sending HTTPS Post request to the Loan API URL and specifies the parmeters according to Loan Request Parameters
  2. PaynetEasy Server returns response described in Loan Response including html that should be sent directly to the customer's browser by merchant.
  3. Merchant sends that html to customer's browser causing customer to be redirected to loan system operator.
  4. Customer signs for a loan with loan system operator.
  5. When done, loan system operator notifies PayneEasy.
  6. PaynetEasy makes a callback to Merchant that the loan sign in is completed using server_callback_url passed with the request

Loan Request Parameters

Parameter name Length/Type Comment Mandatory/Optional
client_orderid 128/String Merchant order identifier. Mandatory
order_desc 125/String Brief order description Mandatory
amount 10/Numeric Amount to be charged. The amount has to be specified in the highest units with "." delimiter. For instance, 10.5 for USD means 10 US Dollars and 50 Cents Mandatory
currency 3/String USD, RUB and so on. Mandatory
first_name 128/String First name of the customer. Mandatory
last_name 128/String Last name of the customer. Mandatory
phone 10/String Customer mobile phone number. Exactly 10 digits. Mandatory
control 40/String Checksum generated by SHA-1. See Request authorization through control parameter for more details. Mandatory
redirect_url 128/String URL the customer will be redirected to upon completion of the transaction. Please note that the customer will be redirected in any case, no matter whether the transaction is approved or declined. Mandatory
server_callback_url 128/String URL the transaction result will be sent to. Merchant may use this URL for custom processing of the transaction completion, e.g. to collect sales data in Merchant's database. See more details at Merchant URL callbacks Optional

Loan Response

Parameter Description
type The type of response. May be "async-loan-response", "validation-error", "error". If type equals "validation-error" or "error", "error-message" and "error-code" parameters contain error details.
status The status code of the order. May be "processing", "error" or "filtered". If type equals "filtered" it means the transaction was considered fraudulent by PaynetEasy Server.
paynet-order-id Order id assigned to the order by PaynetEasy
merchant-order-id Merchant order id
serial-number Unique number assigned by PaynetEasy server to particular request from the Merchant.
html Url-encoded HTML that should be written to the customer's browser to send them to loan system operator.
error-message If status is "error" this parameter contains the reason for decline or error details
error-code The error code is case of "error" status

Payment received callback

When PaynetEasy gets notified by loan system operator that loan is signed in, it makes a callback to Merchant by using server_callback_url passed in the initial request. See Merchant URL callbacks for more details what is passed with callback.

Request authorization through control parameter

The checksum is used to ensure that it is a particular Merchant (and not a fraudster) that initiates the transaction. This SHA-1 checksum, the parameter control, is created by concatenation of the parameters values in the following order:

  • ENDPOINTID
  • client_orderid
  • amount (in cents)
  • currency
  • phone
  • merchant_control

A complete string example may look as follows:

5969200000RUB91212345673E8E45B5-2-42D8-6ECC-FBF6B11B1

Encrypt the string using SHA-1 algorithm. The resultant string yields the control parameter (see [[#{{{txtype}}} Request Parameters|{{{txtype}}} Request Parameters]]) which is required for request authorization. For the above-mentioned example the control will take the following value:

7292b8d938beedc385320875928f39906e8b8d1f
Как нас найти
125445, г. Москва, ул. Смольная, д. 24А
Тел.: 7 (495) 648-67-44