solidgate / ws-client
Php client for webhooks of SolidGate payment gateway
v1.0.1
2021-01-22 09:11 UTC
Requires
- php: ^7.3
- ext-json: *
- ext-openssl: *
- amphp/websocket-client: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpstan/phpstan: ^0.12.58
- phpunit/phpunit: ^9.4
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-01-31 00:30:31 UTC
README
SolidGate Websocket Client
This library provides client for receive SolidGate payment gateway webhooks.
Documentation
https://dev.solidgate.com/developers/documentation
Installation
With Composer
$ composer require solidgate/ws-client
{
"require": {
"solidgate/ws-client": "~1.0"
}
}
Usage
<?php
use SolidGate\WebsocketClient\PrintWebhookHandler;
use SolidGate\WebsocketClient\WebhookReceiver;
$receiver = new WebhookReceiver(new PrintWebhookHandler());
$event = ''; // see full list events on https://solidgate.atlassian.net/
$merchant = ''; // pass your merchantId
$privateKey = ''; // pass your privateKey
try {
$receiver->receive($event, $merchant, $privateKey);
} catch (\SolidGate\WebsocketClient\Exception\ConnectionException $connectionException) {
var_dump($connectionException->getBody()); // handle connection errors (authentication/validation/... error)
}
Run example.php for test usage
php -f example.php