The ApproveDeny SDK for PHP provides an easy way to interact with the ApproveDeny API using PHP.
Requires PHP 8.1+
You can install the package via composer:
composer require ownage/approvedeny-sdk-php
To use the SDK, you need to create an instance of the approvedeny Client
class. You can do this by passing your API key to the constructor.
use Ownage\ApproveDeny\Client;
$client = new Client('your-api-key');
To create a new check request, you need to call the createCheckRequest
method on the client instance.
$checkRequest = $client->createCheckRequest('check-id', [
'description' => 'A description of the check request',
'metadata' => [
'key' => 'value',
],
]);
To retrieve a check request, you need to call the getCheckRequest
method on the client instance.
$checkRequest = $client->getCheckRequest('check-request-id');
To retrieve a check request response, you need to call the getCheckRequestResponse
method on the client instance.
$checkRequestResponse = $client->getCheckRequestResponse('check-request-id');
To verify webhook signatures, you need to call the isValidWebhookSignature
method on the client instance. This method returns a boolean value indicating whether the signature is valid or not.
$isValidSignature = $client->isValidWebhookSignature('your-encryption-key', 'signature', ['foo' => 'bar']);
if ($isValidSignature) {
// The signature is valid
} else
// The signature is invalid
}
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please use the issue tracker.
The MIT License (MIT). Please see License File for more information.