armyan / omnipay-netcash
NetCash driver for the Omnipay Laravel Payment processing library
Requires
- guzzlehttp/guzzle: ^6.3
- omnipay/common: ^3
This package is auto-updated.
Last update: 2024-11-04 22:37:34 UTC
README
NetCash 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 NetCash support for Omnipay.
Installation
Omnipay is installed via Composer. To install, simply add it
to your composer.json
file:
{ "require": { "armyan/omnipay-netcash": "^1.0.0" } }
And run composer to update your dependencies:
composer update
Or you can simply run
composer require armyan/omnipay-netcash
Basic Usage
- Use Omnipay gateway class:
use Omnipay\Omnipay;
- Initialize NetCash gateway:
$gateway = Omnipay::create('NetCash'); $gateway->setVendorKey(env('VENDOR_KEY')); $gateway->setAccountId(env('ACCOUNT_ID')); $gateway->setServiceKey(env('SERVICE_KEY')); // Language $gateway->setAmount(10); // Amount to charge $gateway->setTransactionId(XXXX); // Transaction ID from your system
- Call purchase, it will automatically redirect to NetCash's hosted page
$purchase = $gateway->purchase()->send(); $purchase->redirect();
- Create a webhook controller to handle the callback request at your
RESULT_URL
and catch the webhook as follows
$gateway = Omnipay::create('NetCash'); $gateway->setAccountId(env('ACCOUNT_ID')); $gateway->setServiceKey(env('SERVICE_KEY')); $purchase = $gateway->completePurchase()->send(); // Do the rest with $purchase and response with 'OK' if ($purchase->isSuccessful()) { // Your logic } return new Response('OK');
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 anouncements, 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.