paysera / lib-event-notification-client
PHP REST Client for Paysera event notifications
Installs: 16 885
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 10
Forks: 2
Open Issues: 0
Requires
- php: >=5.5
- fig/http-message-util: ^1.0
- paysera/lib-rest-client-common: ^1.0 | ^2.1
This package is auto-updated.
Last update: 2024-10-24 19:04:56 UTC
README
Provides methods to manipulate EventNotification
API.
It automatically authenticates all requests and maps required data structure for you.
Usage
This library provides ClientFactory
class, which you should use to get the API client itself:
use Paysera\Client\EventNotificationClient\ClientFactory; $clientFactory = ClientFactory::create([ 'base_url' => 'https://checkout-eu-a.paysera.com/notification/rest/v1/', // optional, in case you need a custom one. 'basic' => [ // use this, it API requires Basic authentication. 'username' => 'username', 'password' => 'password', ], 'oauth' => [ // use this, it API requires OAuth v2 authentication. 'token' => [ 'access_token' => 'my-access-token', 'refresh_token' => 'my-refresh-token', ], ], // other configuration options, if needed ]); $eventNotificationClient = $clientFactory->getEventNotificationClient();
Please use only one authentication mechanism, provided by Vendor
.
Now, that you have instance of EventNotificationClient
, you can use following methods
Methods
Mark(read) notification as processed
$result = $eventNotificationClient->readNotification($notificationId);
Get notification with resolved data
$result = $eventNotificationClient->getNotification($notificationId);
Get filtered notifications with resolved data
use Paysera\Client\EventNotificationClient\Entity as Entities; $notificationFilter = new Entities\NotificationFilter(); $notificationFilter->setStatus($status); $result = $eventNotificationClient->getNotifications($notificationFilter);