digitickets / omnipay-payyo
Payyo Gateway for the Omnipay payment processing library
Installs: 17 644
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.2
- omnipay/common: ^3.0
- payyo/php-sdk: ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- http-interop/http-factory-guzzle: ^1.0
- omnipay/tests: ^3.1
- phpstan/phpstan: ^0.12.42
This package is auto-updated.
Last update: 2024-11-09 14:29:50 UTC
README
Payyo Gateway for the Omnipay PHP payment processing library.
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+.
The Payyo Omnipay library requires PHP 7.0+.
Installation
Omnipay can be installed using Composer. Installation instructions.
Run the following command to install omnipay and the Payyo gateway:
composer require digitickets/omnipay-payyo
Basic Usage
The following parameters are required:
apiKey
Your Payyo API/public keysecretKey
Your Payyo secret keymerchantId
Your Payyo merchant ID
$gateway = Omnipay::create('Payyo'); $gateway->setApiKey('api_...'); $gateway->setSecretKey('sec_...'); $gateway->setMerchantId('1234'); $gateway->setTestMode(true); // Send purchase request $response = $gateway->purchase([ 'transactionId' => '123456', 'description' => '1x Book', 'amount' => '10.00', 'currency' => 'USD', 'paymentMethods' => ['credit_card'], 'returnUrl' => 'https://example.org/success', 'cancelUrl' => 'https://example.org/abort', ])->send(); // This is a redirect gateway, so redirect right away $response->redirect();
Requests
Purchase
- purchase() calls
paymentPage.initialize
, then you should redirect - completePurchase() calls
transaction.getNextAction
and (if necessary)transaction.capture
Authorize + Capture
- authorize() calls
paymentPage.initialize
, then you should redirect - completeAuthorize() calls
transaction.getDetails
- capture() calls
transaction.getNextAction
and (if necessary)transaction.capture
Void/Refund
- void() calls
transaction.void
- refund() calls
transaction.refund
Testing
You can run docker-compose up
and then go to http://localhost:8086/
to make a test payment against the Sandbox.