A payment service provider (PSP) offers shops online services for accepting electronic payments by a variety of payment methods including credit card, bank-based payments such as direct debit, bank transfer, and real-time bank transfer based on online banking. Typically, they use a software as a service model and form a single payment gateway for their clients (merchants) to multiple payment methods. read more
This SDK uses composer.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
For more information on how to use/install composer, please visit https://github.com/composer/composer
composer require interkassa/php-sdk
git clone https://github.com/interkassa/php-sdk.git
<?php
require '/path-to-sdk/autoload.php';
<form
name="payment"
method="post"
action="https://sci.interkassa.com/"
accept-charset="UTF-8"
>
<input type="hidden" name="ik_co_id" value="51237daa8f2a2d8413000000" />
<input type="hidden" name="ik_pm_no" value="ID_1234" />
<input type="hidden" name="ik_am" value="1.44" />
<input type="hidden" name="ik_cur" value="uah" />
<input type="hidden" name="ik_desc" value="Payment Description" />
<input type="submit" value="Pay" />
</form>
require 'vendor/autoload.php';
$configuration = new \Interkassa\Helper\Config();
$configuration->setCheckoutSecretKey('5rkFvckBLKcDHQrW');
$configuration->setAuthorizationKey('TpIJabcdefgdtNabcdefgMCeYvdVkF');
$configuration->setAccountId('ffa001aaaa00000000001234');
$SDKClient = new \Interkassa\Interkassa($configuration);
Get link for rediret to SCI (Making invoice) read more
$invoiceRequest = new \Interkassa\Request\GetInvoiceRequest();
$invoiceRequest
->setCheckoutId('5fa005a06a00000000001234')
->setPaymentNumber('ID_1234')
->setAmount('100')
->setCurrency('UAH')
->setDescription('Payment Description');
$url = $SDKClient->makeInvoiceSciLink($invoiceRequest);
$SDKClient->redirect($url);
Get form for redirecting to Pay System with parameters (Making invoice) read more
$invoiceRequest = new \Interkassa\Request\PostInvoiceRequest();
$invoiceRequest
->setCheckoutId('5fa005a06a00000000001234')
->setPaymentNumber('ID_1234')
->setAmount('100')
->setCurrency('UAH')
->setDescription('Payment Description')
->setAction('process')
->setPaywayVia('test_interkassa_test_xts');
$result = $SDKClient->makeInvoicePaySystemLink($invoiceRequest);
$code = $result->getCode();
$status = $result->getStatus();
$message = $result->getMessage();
$data = $result->getData();
$html = $SDKClient->redirectForm($data);
echo $html;
Calculate invoice read more
$invoiceRequest = new \Interkassa\Request\CalculateRequest();
$invoiceRequest
->setCheckoutId('5fa005a06a00000000001234')
->setPaymentNumber('ID_1234')
->setAmount('100')
->setCurrency('UAH')
->setDescription('Payment Description')
->setAction('payway')
->setPaywayVia('test_interkassa_test_xts');
$result = $SDKClient->calculateInvoice($invoiceRequest);
$code = $result->getCode();
$status = $result->getStatus();
$message = $result->getMessage();
$data = $result->getData();
Obtaining a list of payment directions available for the checkout. read more
$invoiceRequest = new \Interkassa\Request\PaymentDirectionsRequest();
$invoiceRequest
->setCheckoutId('5fa005a06a00000000001234')
->setPaymentNumber('ID_1234')
->setAmount('100')
->setCurrency('UAH')
->setDescription('Payment Description')
->setAction('payways');
->setPaymentMethod('visa')
->setPaymentCurrency('USD');
$result = $SDKClient->getPaymentDirection($invoiceRequest);
$code = $result->getCode();
$status = $result->getStatus();
$message = $result->getMessage();
$data = $result->getData();
Returns all currency read more
$result = $SDKClient->getCurrencyList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns concrete currency by ID read more
$result = $SDKClient->getCurrencyById('30');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns list of payment directions for input included in the Interkassa system. read more
$result = $SDKClient->getPaysystemInputPaywayList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns a payment direction for input by a specified ID included in the Interkassa system. read more
$result = $SDKClient->getPaysystemInputPaywayById('11a001111100000000001234');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns list of payment directions for withdrawal included in the Interkassa system. read more
$result = $SDKClient->getPaysystemOutputPaywayList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns a payment direction for withdrawal, included in the Interkassa system. read more
$result = $SDKClient->getPaysystemOutputPaywayById('11a001111100000000004321');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns list of accounts available to the user read more
$result = $SDKClient->getAccountList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns account data for a given ID read more
$result = $SDKClient->getAccountById('ffa001aaaa00000000001234');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns list of checkouts linked to your account. read more
$result = $SDKClient->getCheckoutList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns checkout data for a given ID. read more
$result = $SDKClient->getCheckoutById('11a002222200000000004321');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns all payments. read more
$result = $SDKClient->getAllInvoices();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns data of payment by ID. read more
$result = $SDKClient->getInvoiceById('134001234');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns a list of made payment withdrawals. read more
$result = $SDKClient->getWithdrawList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns information on a specific payment withdrawal ID. read more
$result = $SDKClient->getWithdrawById('15001234');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns list of purses associated with an account, with their parameters. read more
$result = $SDKClient->getPurseList();
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
$result = $SDKClient->getPurseList([
'checkoutId' => '11a002222200000000004321',
'currency' => '20'
]);
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Returns purse data for a given ID. read more
$result = $SDKClient->getPurseById('404300001234');
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Creates a refund in the Interkassa system. read more
$refundRequest = new \Interkassa\Request\RefundRequest();
$refundRequest
->setId('134001234')
->setAmount('15')
->setDescription('Reason of the refund');
$result = $SDKClient->makeRefund($refundRequest);
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
Creates a new withdraw in the Interkassa system. read more
$withdrawRequest = new \Interkassa\Request\WithdrawRequest();
$withdrawRequest
->setAmount('15')
->setMethod('card')
->setCurrency('uah')
->setAction('process')
->setDetail('card', '5100123412341234')
->setPurseId('300000912345')
->setUseShortAlias('true');
$result = $SDKClient->makeWithdraw($withdrawRequest);
$code = $result->getCode();
$status = $result->getStatus();
$data = $result->getData();
See api-docs