Download the PHP package pashamesh/psb-acquiring-php-sdk without Composer
On this page you can find all versions of the php package pashamesh/psb-acquiring-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pashamesh/psb-acquiring-php-sdk
More information about pashamesh/psb-acquiring-php-sdk
Files in pashamesh/psb-acquiring-php-sdk
Package psb-acquiring-php-sdk
Short Description PromSvyazBank (https://www.psbank.ru/) acquiring API PHP Software Development Kit.
License MIT
Informations about the package psb-acquiring-php-sdk
acquiring API PHP SDK.
This package provides Software Development Kit for PromSvyazBank (PSB) Acquiring API.
Installation
You can install the package via composer:
Usage
Setup client
Setup instance of Config
:
where component1
, component2
, merchantNumber
and terminalNumber
are credentials provided by bank.
Test environment
To configure client to use test environment for test and development purposes just skip component1
and component2
:
How to use
Preauthorization
Start preauthorization
Render and automatically submit preauthorization form which will redirect customer to the bank payment page:
Or it's possible to get form HTML content if you need more control:
It's also possible to get payment link for preauthorization which maybe sent to customer by email for example:
To save card during the preauthorization process use preauthorizeAndSaveCard
method:
Notification HTTP call will contain TOKEN_ID
identifying saved card.
There is a preauthorizeUsingCard
to do preauthorization and use already saved card:
Complete preauthorization
Cancel preauthorization
Purchase
Purchase uses similar to preauthorization workflow. Render and automatically submit preauthorization form which will redirect customer to the bank payment page:
Or get form HTML content :
Or get payment link for purchase:
To save card during the purchase process use purchaseAndSaveCard
method:
There is a purchaseUsingCard
to do purchase and use already saved card:
Recurring payment
Register
Do payment
Refund
Cards
Save card from existing transaction
$syncResponse
will contain TOKEN_ID
identifying saved card.
Forget saved card
Handle callback HTTP call
Payload of asynchronous HTTP callback request must be validated for valid signature.
SDK provide convenient method handleCallbackRequest
.
It validates signature and returns Payload model with request attributes.
Example
Development
There is a Docker-compose setup and set of handy make
shortcuts for development purposes.
Install dependencies
Use next command to install composer dependencies:
Code styling
This package follows the PSR-12 coding standard and the PSR-4 autoload standard.
Use next command to fix code styling:
Running tests
Use next command to run Unit
and code static analysis: