This is a set of libraries in the PHP language to ease integration of your service with the EcommPay Payment Page.
Please note that for correct SDK operating you must have at least PHP 7.0.
Install with composer
composer require ecommpay/paymentpage-sdk
$gate = new ecommpay\Gate('secret');
$payment = new ecommpay\Payment(100);
$payment->setPaymentAmount(1000)->setPaymentCurrency('RUB');
$url = $gate->getPurchasePaymentPageUrl($payment);
$url
here is the signed URL.
You'll need to autoload this code in order to handle notifications:
$gate = new ecommpay\Gate('secret');
$callback = $gate->handleCallback($data);
$data
is the JSON data received from payment system;
$callback
is the Callback object describing properties received from payment system;
$callback
implements these methods:
Callback::getPaymentStatus();
Get payment status.Callback::getPayment();
Get all payment data.Callback::getPaymentId();
Get payment ID in your system.
- Payment Page opening
- Notifications handling
- Direct Gate requests
- PHPDoc