Purchase using card token
Request parameters
order_id
- Order ID which is generated by merchant.order_desc
- Order description. Generated by merchant in UTF-8.amount
- Order amount in cents without separatorcurrency
- Order currency. Supported values (UAH, RUB, USD, EUR, GBP)response_url
- Merchant site URL, where customer will be redirected after payment completion.required_rectoken
- Flag which indicates whether FONDY must return card token — token to access card funds without cardholder interaction
<?php
require_once('path/to/init.php');
$data = $ipsp->call('checkout',array(
'order_id' => 'orderid-111222333',
'order_desc' => 'Simple checkout page',
'currency' => $ipsp::USD ,
'amount' => 2000, // 20 USD
'response_url'=> sprintf('http://shop.example.com/checkout/result')
'required_rectoken'=>'y'
));
$data->redirectToCheckout();
After success response save rectoken post parameter handled on response_url with other protocol data. To make purchase using card token, request must contain additional parameter rectoken, and called with recurring method name.
<?php
require_once('path/to/init.php');
$data = $ipsp->call('recurring',array(
'order_id' => 'orderid-111222333',
'order_desc' => 'Simple checkout page',
'currency' => $ipsp::USD ,
'amount' => 2000, // 20 USD
'response_url'=> sprintf('http://shop.example.com/checkout/recurring'),
'rectoken' => RECTOKEN
));
$result = $data->getResponse();