k3rnel / omnipay-easy-pay
EasyPay gateway for Omnipay payment processing library
Installs: 10 714
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- ext-json: *
- guzzlehttp/guzzle: ^7.8
- omnipay/common: ^3.0
- php-http/guzzle7-adapter: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.40
- http-interop/http-factory-guzzle: ^1.2
- omnipay/tests: ^4
- symfony/var-dumper: ^6.4
This package is auto-updated.
Last update: 2024-11-03 10:49:54 UTC
README
EasyPay driver for the Omnipay Laravel payment processing library
Omnipay is a framework-agnostic, multi-gateway payment processing library for PHP 5.5+. This package implements EasyPay support for Omnipay.
Installation
Omnipay is installed via Composer. To install, add it
to your composer.json
file:
{ "require": { "k3rnel/omnipay-easy-pay": "^1.0" } }
Run composer to update your dependencies:
composer update
Or you can run
composer require k3rnel/omnipay-easy-pay
Basic Usage
- Initialize EasyPay gateway:
use Omnipay\Omnipay; use Omnipay\EasyPay\EasyPayGateway; $gateway = Omnipay::create(EasyPayGateway::class); $gateway->setMerchantId('12345678'); // E-Merchant unique ID provided by EasyPay after being integrated $gateway->setMerchantToken('8f11efa4-4041-4e28-a191-0cc01c4ff66c'); // Merchant token (key) provided by EasyPay after being integrated
- Call purchase, it will automatically redirect to EasyPay's hosted page
$purchaseRequest = $gateway->purchase(); $purchaseRequest->setTransactionId('123456'); // Order ID of the merchant system. $purchaseRequest->setAmount(5); // Transaction amount
- Create a controller to handle the callback request. This URL merchant should provide EasyPay during registration.
$gateway = Omnipay::create(EasyPayGateway::class); $gateway->setMerchantId('12345678'); $gateway->setMerchantToken('8f11efa4-4041-4e28-a191-0cc01c4ff66c'); $fetchTransactionRequest = $gateway->fetchTransaction(); $fetchTransactionRequest->setTransactionId('123456'); $fetchTransactionResponse = $fetchTransactionRequest->send(); if ($fetchTransactionResponse->isSuccessful()) { // Your logic is to mark the order as paid. }
For general usage instructions, please see the main Omnipay repository.
Support
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.