payson/paysonpayments

Payson Recurring Payments and Payson Checkout API client for PHP

2.1.2 2019-10-01 10:10 UTC

This package is not auto-updated.

Last update: 2024-06-06 07:43:51 UTC


README

Payson Recurring Payments and Payson Checkout API client for PHP

Setup using Composer

composer require payson/paysonpayments

Setup using include

require_once 'include.php';

Create connector

// Include library (without composer)
require_once 'include.php';

// Connect to test environment
$agentId = '4';
$apiKey = '2acab30d-fe50-426f-90d7-8c60a7eb31d4';
$apiUrl = \Payson\Payments\Transport\Connector::TEST_BASE_URL;
 
$connector = \Payson\Payments\Transport\Connector::init($agentId, $apiKey, $apiUrl);

Create Payson Checkout client

$checkoutClient = new \Payson\Payments\CheckoutClient($connector);

Create Recurring Subscription client

$recurringSubscriptionClient = new \Payson\Payments\RecurringSubscriptionClient($connector);

Create Recurring Payment client

$recurringPaymentClient = new \Payson\Payments\RecurringPaymentClient($connector);

Example method: getAccountInfo()

// getAccountInfo() can be used with all three clients
$accountInformation = $checkoutClient->getAccountInfo();

// Print the result
print('<pre>' . print_r($accountInformation, true) . '</pre>');

Methods

Payson Checkout (\Payson\Payments\CheckoutClient)
  • getAccountInfo()
  • create()
  • get()
  • update()
  • listCheckouts()
Payson Recurring Subscription (\Payson\Payments\RecurringSubscriptionClient)
  • getAccountInfo()
  • create()
  • get()
  • update()
  • listRecurringSubscriptions()
Payson Recurring Payment (\Payson\Payments\RecurringPaymentClient)
  • getAccountInfo()
  • create()
  • get()
  • update()
  • listRecurringPayments()

Examples

See files in the examples folder for examples of all methods.

Documentation

Use Payson Checkout REST API or Payson Recurring Payments REST API for more information about available parameters.

Test credentials

For instant access to our test environment simply create a Payson TestAccount to get your own Agent ID and API Key.

Requirements

cURL PHP >= 7.0