sudiptpa / omnipay-esewa
eSewa API driver for the Omnipay payment processing library.
Installs: 3 503
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- omnipay/common: ^3
Requires (Dev)
- omnipay/tests: ^3
- phpro/grumphp: ^0.14.0
- squizlabs/php_codesniffer: ^3
This package is auto-updated.
Last update: 2024-11-04 12:38:53 UTC
README
eSewa driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements eSewa support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply require league/omnipay
and sudiptpa/omnipay-esewa
with Composer:
composer require league/omnipay sudiptpa/omnipay-esewa
Basic Usage
Purchase
use Omnipay\Omnipay; use Exception; $gateway = Omnipay::create('Esewa_Secure'); $gateway->setMerchantCode('epay_payment'); $gateway->setTestMode(true); try { $response = $gateway->purchase([ 'amount' => 100, 'deliveryCharge' => 0, 'serviceCharge' => 0, 'taxAmount' => 0, 'totalAmount' => 100, 'productCode' => 'ABAC2098', 'returnUrl' => 'https://merchant.com/payment/1/complete', 'failedUrl' => 'https://merchant.com/payment/1/failed', ])->send(); if ($response->isRedirect()) { $response->redirect(); } } catch (Exception $e) { return $e->getMessage(); }
After successful payment and redirect back to merchant site, you need to now verify the payment with another API request.
Verify Payment
$gateway = Omnipay::create('Esewa_Secure'); $gateway->setMerchantCode('epay_payment'); $gateway->setTestMode(true); $response = $gateway->verifyPayment([ 'amount' => 100, 'referenceNumber' => 'GDFG89', 'productCode' => 'gadfg-gadf', ])->send(); if ($response->isSuccessful()) { // Success } // Failed
Laravel Integration
Please follow the eSewa Online Payment Gateway Integration and follow step by step guidlines.
Official Doc
Please follow the Official Doc to understand about the parameters and their descriptions.
Contributing
Contributions are welcome and will be fully credited.
Contributions can be made via a Pull Request on Github.
Support
If you are having general issues with Omnipay Esewa, drop an email to sudiptpa@gmail.com for quick support.
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.
License
This package is open-sourced software licensed under the MIT license.