libyaguide / gpay-api-client
GPay API PHP Client Library for interacting with the GPay Payment API.
1.0.0
2025-06-25 13:45 UTC
Requires
- php: >=7.2
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