Search by

forumpay / payment-gateway-php-client

forumpay

Payment Gateway PHP Api Client

Package info

github.com/forumpay/payment-gateway-php-client

pkg:composer/forumpay/payment-gateway-php-client

Statistics

Installs: 21 883

Dependents: 2

Suggesters: 0

Stars: 4

Open Issues: 0

v1.8.1 2026-10-22 12:16 UTC

README

PHP Client for interacting with Payment Gateway Webhost API

Requirements

  • PHP >= 8.0 with ext-curl and ext-json

The client does not restrict you to a specific PHP version. It is tested on PHP 8.1 and 8.5, and works on any version up to 8.5. We recommend using the latest PHP 8.5 release.

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; it must be an HTTPS URL without credentials, query string or fragment, otherwise the constructor throws InvalidArgumentException

$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

  • Ping
  • Me
  • GetRate
  • GetRates
  • StartPayment
  • CheckPayment
  • GetTransactions
  • CancelPayment
  • GetCurrencyList
  • RequestKyc
  • GetWalletApps

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