Omnipay: Komerci WebServer (Rede)
, (*1)
Komerci WebService (Rede) driver for the Omnipay PHP payment processing library, (*2)
Omnipay is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+., (*3)
Installation
Omnipay is installed via Composer. To install, simply add it
to your composer.json
file:, (*4)
{
"require": {
"byjg/omnipay-komerci": "~1.0"
}
}
And run composer to update your dependencies:, (*5)
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
Basic Usage
The following gateways are provided by this package:, (*6)
Komerci is the solution for e-commerce from Rede (former Redecard). Rede is a Brazilian acquirer.
This is responsible for the authentication, authorization and capture the card data in the Rede environment., (*7)
NOTE: Before using this driver is necessary to register the IP in the Komerci website.
If your IP is not registered you'll get an error 500 or an error code 23 - "Transação não autorizada"., (*8)
// Setup payment gateway
$gateway = Omnipay::create('Komerci');
$gateway->setApiKey('00000000');
$gateway->setUsername('user');
$gateway->setPassword('pass');
$gateway->setTestMode(true);
// Example form data
$formData = [
'name' => 'Joao Magalhaes',
'number' => '4242424242424242',
'expiryMonth' => '6',
'expiryYear' => '2016',
'cvv' => '123'
];
// Send purchase request
$response = $gateway->purchase(
[
'amount' => '10.00',
'transactionId' => '1234',
'card' => $formData,
]
)->send();
Komerci have a test environment where the credicard will not be charged but you'll receive real messages for testing your system. Just use $gateway->setTestMode(true) for use the test environment., (*9)
For general usage instructions, please see the main Omnipay
repository., (*10)
Implemented methods
* authorize
* capture
* purchse
* void, (*11)
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., (*12)
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., (*13)
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., (*14)