Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 36 | | All time: 11,013 This week: 206 |
|
Description | | Author |
This package can send HTTP requests to the PayDirectly API.
It provides several classes that can send HTTP requests to the PayDirectly API using Curl or the Guzzle package.
The package can compose the HTTP requests to set the necessary headers to set API tokens. It can also retrieve the request responses and decode them before returning the response to the application.
| |
|
Example
<?php
error_reporting(1);
ini_set('display_errors', 1);
require 'vendor/autoload.php';
use Paydirectly\Exceptions\RESTfulException;
$params = [
]
try {
$paydirectly = new \Paydirectly\Paydirectly(
array(
'merchant_id'=>'HyuNMmX9cThGm5tRGz1JMZSG7DCDjd',
'secret_key'=>
'WUdtL0cxMFcwTjlHZVpHOWxNQlB3MmozU25DRzF2ZDZkUmkwUjdtNzFBSkdMdWVKc0JMYldqNDM5OGtobG9NcGRrcThDWG1wTWxob0doMVlEdnFCL0hBQWUreHpHNUlOVGt3UGN0dlVFZHlpNVZqZWRwTDhySVJOdnNuNmNKVjQ=',
'client_handler'=>'guzzle'
));
$response = $paydirectly->post('orders/create-checkout', $params);
print_r($response);
} catch (RESTfulException $e) {
echo $e->getErrorCode();
echo $e->getMessage();
echo $e->getErrorList();
exit;
}
?>
|
Details
<p align="center">
</p>
Paydirectly SDK for PHP
PHP library for paydirectly API.
Installation
The recommended way to install paydirectly-php is through Composer:
composer require paydirectly/paydirectly-php
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
Quickstart
All configs are passed around as a single variable config
:
$paydirectly = new \paydirectly\paydirectly([
'merchant_id' => 'id_ ...',
'secret_key' => 'sk_live_ ...',
]);
Documentation
Fantastic documentation is available at https://php.paydirectly.io.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.