Skip to content

voodoo-dn/paymentpage_sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EcommPay PHP SDK

Build Status Test Coverage Maintainability

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.

Payment flow

Payment flow

Installation

Install with composer

composer require ecommpay/paymentpage-sdk

Get URL for payment

$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.

Handle callback from Ecommpay

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:

  1. Callback::getPaymentStatus(); Get payment status.
  2. Callback::getPayment(); Get all payment data.
  3. Callback::getPaymentId(); Get payment ID in your system.

TODO

  • Payment Page opening
  • Notifications handling
  • Direct Gate requests
  • PHPDoc

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%