Converse 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 Converse support for Omnipay.
Omnipay is installed via Composer. To install, simply add it
to your composer.json
file:
{
"require": {
"ucraft-com/omnipay-converse": "^1.0"
}
}
And run composer to update your dependencies:
composer update
Or you can simply run
composer require ucraft-com/omnipay-converse
- Initialize Converse gateway:
use Omnipay\Omnipay;
use Omnipay\Converse\ConverseGateway;
$gateway = Omnipay::create(ConverseGateway::class);
$gateway->setMerchantId('123'); // Merchant ID, provided by ConverseBank
$gateway->setMerchantToken('*******************************'); // Merchant password, provided by ConverseBank
- Call purchase, it will automatically redirect to ConverseBank's hosted page
$response = $gateway->purchase([
'amount' => '10',
'returnUrl' => 'http:\/\/cportal.im\/hy\/test?back=1&order_number=1',
'language' => 'en',
'currency' => 'EUR',
'orderNumber' => '000866',
])->send();
redirect($response->getRedirectUrl());
- Create a controller to handle the callback request. This URL merchant should provide ConverseBank during registration.
$fetchTransactionResponse = $gateway->fetchTransaction([
'transactionId' => 'some-transaction-id',
])->send();
if ($fetchTransactionResponse->isSuccessful()) {
// Your logic is to mark the order as paid.
}
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 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.