CorvusPay driver for the Omnipay payment processing PHP library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.6+. This package implements CorvusPay support for Omnipay.
Omnipay is installed via Composer. To install, add it to your
composer.json
file:
{
"require": {
"eoler/omnipay-corvuspay": "~1.0"
}
}
And run composer to update your dependencies:
composer update
Or you can simply run:
composer require eoler/omnipay-corvuspay
- Use Omnipay gateway class:
use Omnipay\Omnipay;
- Initialize CorvusPay gateway:
$gateway = Omnipay::create('CorvusPay');
$gateway->initialize([
'apiKey' => env('API_KEY'),
'storeId' => env('STORE_ID'),
'testMode' => env('APP_DEBUG'),
'language' => \App::getLocale(),
]);
- Call purchase, it will send user to CorvusPay checkout endpoint:
$response = $gateway->purchase([
'transactionId' => $order->id,
'amount' => $order->amount,
'currency' => $order->currencyCode,
'description' => $order->products->list(),
'email' => $order->customer->email,
])->send();
return $response->getRedirectResponse();
- Create a webhook to handle the callback request at your
RESULT_URL
and catch notification with:
$gateway = Omnipay::create('CorvusPay');
$gateway->initialize([
'apiKey' => env('API_KEY'),
'storeId' => env('STORE_ID'),
'testMode' => env('APP_DEBUG'),
'language' => \App::getLocale(),
]);
$purchase = $gateway->completePurchase()->send();
if ($purchase->isSuccessful()) {
// Bookkeeping: save completed status, etc.
}
For general usage instructions, please see the main Omnipay repository.
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.