1. Go to this page and download the library: Download blackpayment/php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
blackpayment / php-sdk example snippets
# Установите Composer
curl -sS https://getcomposer.org/installer | php
# Добавьте BLACK PAYMENT в зависимость
php composer.phar
use BlackPayment\BlackPayment;
# В первую очередь необходимо инициализировать наш SDK для Вашего магазина.
$bp = new BlackPayment("ВАШ API TOKEN","ВАШ SECRET KEY");
# Теперь можно отправлять запрос создания платежа.
$response = $bp->makeAction('makePayment', array('amount' => 420,
'currency' => 'RUB',
'description' => 'Payment For Doge',
'order' => 'MUCHORDER'));
# Исследуем ответ от API.
if(isset($response->url)) {
$paymentid = $response->paymentid; //Идентификатор платежа внутри BLACK PAYMENT
$paymentUrl = $response->url; //Ссылка платежа
}elseif (isset($response->error)) {
print 'Ошибка: '.$response->errorDescription;
}else {
print 'Фатальная ошибка';
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.