libyaguide/gpay-api-client

GPay API PHP Client Library for interacting with the GPay Payment API.

Maintainers

Package info

github.com/Libya-Guide/GPay-PHP-SDK

pkg:composer/libyaguide/gpay-api-client

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2025-06-25 13:45 UTC

This package is not auto-updated.

Last update: 2026-04-16 16:03:46 UTC


README

A PHP client for the GPay Payment API. Handles authentication, request signing, response verification, and endpoint logic.

Official GPay API Documentation

For full API details, see the GPay API Documentation.

Installation

Install via Composer:

composer require libyaguide/gpay-api-client

Usage

Import and Create the Client

require 'vendor/autoload.php';
use GPay\GPayApiClient;
use GPay\BaseUrl;

$client = new GPayApiClient(
    'your_api_key',
    'your_secret_key',
    'your_password',
    BaseUrl::STAGING // or BaseUrl::PRODUCTION
);

Get Wallet Balance

// type: Balance
$balance = $client->getBalance();
print_r($balance);

Create a Payment Request

// type: PaymentRequest
$paymentRequest = $client->createPaymentRequest('100.00', 'INV-123', 'Invoice Payment');
print_r($paymentRequest);

Check Payment Status

// type: PaymentStatus
$status = $client->checkPaymentStatus($paymentRequest->requestId);
print_r($status);

Send Money

// type: SendMoneyResult
$sendResult = $client->sendMoney('50.00', 'recipient_wallet_id', 'Gift', 'GIFT-001');
print_r($sendResult);

Get Day Statement

// type: Statement
$statement = $client->getDayStatement('2025-06-22');
print_r($statement);
foreach ($statement->dayStatement as $tx) {
    // tx: StatementTransaction
    print_r($tx);
}

Check Wallet

// type: WalletCheck
$walletInfo = $client->checkWallet('recipient_wallet_id');
print_r($walletInfo);

Get Outstanding Transactions

// type: OutstandingTransactions
$outstanding = $client->getOutstandingTransactions();
print_r($outstanding);
foreach ($outstanding->outstandingTransactions as $tx) {
    // tx: OutstandingTransaction
    print_r($tx);
}

License

MIT