This option is available when the ING Lease Now service is enabled.
The basic request creating the payment must be accompanied by a cart object with an items array containing the following parameters:
| Parameter | Type | Required parameter | Description |
|---|---|---|---|
id |
string | YES |
Product identifier |
name |
string | YES |
Name of the product |
amount |
integer | YES |
Unit value of the net product in the smallest unit of currency - pennies. The value 0 is also allowed. |
tax |
integer | YES |
Tax unit value |
taxStake |
string | YES |
Tax rate. Available values: 23, 22, 8, 7, 5, 3, 0, TAX_EXEMPT, TAX_NOT_LIABLE, TAX_REVERSE_CHARGE, TAX_EXCLUDING |
quantity |
integer | YES |
Quantity. Minimum value is 0 |
url |
string | YES |
The url for the product in question |
categoryId |
string | YES |
Category identifier |
unit |
string | NO |
unit |
state |
integer | NO |
Product state. available values: NEW, USED |
discount.amount |
integer | NO |
Value of discount |
discount.tax |
integer | NO |
Discount tax value |
The minimum value for a single product in Leasing is PLN 1,000, while the value of the entire basket must be at least PLN 5,000. The amounts given are net amounts.
Example data structure
$cart = [
'items' => [
[
'id' => 1,
'categoryId' => 'category123',
'name' => 'Product name',
'amount' => 1000,
'tax' => 230,
'taxStake' => 23,
'quantity' => 1,
'unit' => 'szt',
'url' => 'https://product.url',
'state' => 'NEW',
'discount' => [
'amount' => 100,
'tax' => 23,
]
]
]
];
The above parameters should be taken into account when calculating the signature in accordance with the section Authorisation.
Preparing the cart object
Using the PHP function
The data collected from the above parameters should be encoded using the function:
base64_encode(gzencode(json_encode($cart), 5));
where:
$cart - previously prepared parameters
$cart = [
'items' => [
[
'id' => 1,
'categoryId' => 'category123',
'name' => 'Product name',
'amount' => 500000,
'tax' => 115000,
'taxStake' => 23,
'quantity' => 1,
'unit' => 'szt',
'url' => 'https://product.url',
'state' => 'NEW',
'discount' => [
'amount' => 100,
'tax' => 23,
],
],
],
];
$cart = base64_encode(gzencode(json_encode($cart), 5));
$fields = [
'serviceId' => '63f574ed-d90d-4abe-9cs1-39117584a7b7',
'merchantId' => '6yt3gjtm9p1odfgx8491',
'amount' => '615000',
'currency' => 'PLN',
'orderId' => '123',
'orderDescription' => '#Example transaction',
'customerFirstName' => 'Jan',
'customerLastName' => 'Kowalski',
'customerEmail' => 'jan.kowalski@example.com',
'customerPhone' => '515515515',
'urlSuccess' => 'https://your-shop.com/success',
'urlFailure' => 'https://your-shop.com/failure',
'urlReturn' => 'https://your-shop.com/return',
'cart' => $cart,
];
$serviceKey = 'eAyhFLuHgwl5hu-32GM8QVlCVMWRU0dGjH1c';
$hashMethod = 'sha256';
$signature = createSignature(
$fields,
$serviceKey,
$hashMethod
) . ';' . $hashMethod;
Using the additional parameter visibleMethod with the value lease will display only Leasing on the gateway. This allows you to extract a given method as a separate item in the summary.
Example form content
<input type="hidden" value="63f574ed-d90d-4abe-9cs1-39117584a7b7" name="serviceId">
<input type="hidden" value="6yt3gjtm9p1odfgx8491" name="merchantId">
<input type="hidden" value="300" name="amount">
<input type="hidden" value="PLN" name="currency">
<input type="hidden" value="123" name="orderId">
<input type="hidden" value="Example transaction" name="orderDescription">
<input type="hidden" value="John" name="customerFirstName">
<input type="hidden" value="Doe" name="customerLastName">
<input type="hidden" value="johndoe@domain.com" name="customerEmail">
<input type="hidden" value="501501501" name="customerPhone">
<input type="hidden" value="https://your-shop.com/success" name="urlSuccess">
<input type="hidden" value="https://your-shop.com/failure" name="urlFailure">
<input type="hidden" value="https://your-shop.com/return" name="urlReturn">
<input type="hidden" value="<?= $cart ?>" name="cart">