paygateglobal / paygate-php
Sdk php pour PaygateGlobal
1.0.5
2023-10-20 03:57 UTC
Requires
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^8.5
README
Raw Files
git clone https://github.com/Edouardsnipeur/paygate-php.git
Installing
Using composer:
composer require paygateglobal/paygate-php
Initialization
Production
$paygate = new \Paygate\Paygate($auth_token);
Request to schedule payout
EXAMPLE API Method
// Example to schedule payout API Method $response = $paygate->payNow( phone_number : "99000000", amount : 1000, identifier : "993", network : \Paygate\Network::FLOOZ, description : "My description", //Optionnal );
EXAMPLE redirect Method
// Example to schedule payout redirect Method $paygate->redirectPayNow( phone_number : "99000000", //Optionnal amount : 1000, identifier : "993", url : "http://exemple.com", //Optionnal description : "My description", //Optionnal );
TRANSACTION $response Object
TRANSACTION POSSIBLE STATUS LIST
TRANSACTION VERIFICATION EXAMPLE
switch ($response->status) { case \Paygate\TransactionStatus::SUCCESS //... break; case \Paygate\TransactionStatus::INVALID_TOKEN: //... break; case \Paygate\TransactionStatus::INVALID_PARAMS: //... break; case \Paygate\TransactionStatus::DOUBLONS: //... break; case \Paygate\TransactionStatus::INTERNAL_ERROR: //... break; }
Request to retrieve transactions
EXAMPLE
// Verification with Paygate reference code $reponse = $paygate->verifyTransactionWithPaygateReference($tx_reference); // Verification with Ecommerce identifier $reponse = $paygate->verifyTransactionWithEcommerceId($identifier);
TRANSACTION $response Object
PAYMENT POSSIBLE STATUS LIST
TRANSACTION VERIFICATION EXAMPLE
switch ($response->status) { case \Paygate\PaiementStatus::SUCCESS //... break; case \Paygate\PaiementStatus::PENDING: //... break; case \Paygate\PaiementStatus::EXPIRED: //... break; case \Paygate\PaiementStatus::CANCELED: //... break; }