festpay/paymentpage-sdk

dev-main 2022-12-20 10:28 UTC

This package is auto-updated.

Last update: 2025-06-23 21:47:35 UTC


README

Build Status

This is a set of libraries in the PHP language to ease integration of your service with the FestPay 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 festpay/paymentpage-sdk

Get URL for payment

$gate = new festpay\Gate('secret');
$payment = new festpay\Payment('11', 'some payment id');
$payment->setPaymentAmount(1000)->setPaymentCurrency('RUB');
$url = $gate->getPurchasePaymentPageUrl($payment);

$url here is the signed URL.

If you want to use another domain for URL you can change it with optional Gate constructor parameter:

new festpay\Gate('secret', 'https://mydomain.com/payment');

or change it with method

$gate->setPaymentBaseUrl('https://mydomain.com/payment');

Handle callback from FestPay

You'll need to autoload this code in order to handle notifications:

$gate = new festpay\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