forumpay/payment-gateway-php-client

Payment Gateway PHP Api Client

v1.1.3 2024-02-06 13:54 UTC

This package is auto-updated.

Last update: 2024-04-06 14:09:42 UTC


README

PHP Client for interacting with Payment Gateway Webhost API

Install

Run composer require forumpay/payment-gateway-php-client

Usage

Example usage for getting currency list.

use ForumPay\PaymentGateway\PHPClient\PaymentGatewayApi;

$paymentGatewayApi = new PaymentGatewayApi(
    $paymentGatewayUri,
    $apiUser,
    $apiSecret,
    $userAgentApplicationIdentifier
);

try {
    $getCurrencyListResponse = $paymentGatewayApi->getCurrencyList('EUR');
} catch (ApiExceptionInterface $exception) {
    //TODO: handle the exception
}

Where:

$paymentGatewayUri is Service URL as per API documentation

$apiUser and $apiSecret are credentials for Payment Gateway API Keys

$userAgentApplicationIdentifier represents the user agent application identifier for HTTP the client. Example: ('MyPaymentApp/1.0.0')

Payment Gateway API Keys

Available endpoints

  • GetRate
  • StartPayment
  • CheckPayment
  • GetTransactions
  • CancelPayment
  • GetCurrencyList

For corresponding methods refer to PaymentGatewayApiInterface in src/PaymentGatewayApiInterface.php