THIS PROJECT IS NO LONGER BEING MAINTAINED
This package makes it easy to use eRede PHP SDK with Laravel framework.
This package can be installed via composer:
composer require lucasgiovanny/laravel-erede
Set the enviroments variables in your .env
file
REDE_PV=
REDE_TOKEN=
REDE_SANDBOX=false
To use this package, you just need to import the Rede Facades.
use lucasgiovanny\ERede\Facades\Rede;
authorize
: Authorize a transaction with creditcard.cancel
: Cancel a transaction.get
: Find a transaction by id.getByReference
: Find a transaction by reference.getRefunds
: Find transaction refunds.
Param | Type | Default |
---|---|---|
total | float (required) | |
reference | string (required) | |
creditcard | array (required) | |
capture | bool | true |
installments | int | 1 |
Example:
use lucasgiovanny\ERede\Facades\Rede;
$creditCard = [
'cardNumber' => "5448280000000007",
'cardCvv' => '123'
'cardExpirationMonth' => '12',
'cardExpirationYear' => '2020',
'cardHolder' => 'Walter White',
];
$transaction = Rede::authorize(100.99, 'Order 45', $creditCard);
if ($transaction->getReturnCode() == '00') {
printf("Success! tid=%s\n", $transaction->getTid());
}
-
Transactions are captured by default, if you don't want this, you can set the capture parameter to
false
. -
To set installments, just use the last parameter.
Param | Type |
---|---|
transaction | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede;
$transaction = Rede::cancel('TID123');
Param | Type |
---|---|
transaction | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede;
$transaction = Rede::get('TID123');
Param | Type |
---|---|
reference | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede;
$transaction = Rede::getByReference('TID123');
Param | Type |
---|---|
transaction | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede;
$transaction = Rede::getRefunds('TID123');
- Tests
Please see CHANGELOG for more information what has changed recently.
Test needs to be written. Feel free to collaborate.
If you discover any security related issues, please email lucasgiovanny@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.