lucasgiovanny / laravel-erede
Laravel Service Provider to use eRede PHP SDK
Fund package maintenance!
lucasgiovanny
Requires
- php: ^8.0.2
- developersrede/erede-php: ^5.1
- illuminate/support: ^9.0
README
THIS PROJECT IS NO LONGER BEING MAINTAINED
This package makes it easy to use eRede PHP SDK with Laravel framework.
Contents
Installation
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
Usage
To use this package, you just need to import the Rede Facades.
use lucasgiovanny\ERede\Facades\Rede;
Available methods
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.
authorize
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.
cancel
Param | Type |
---|---|
transaction | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede; $transaction = Rede::cancel('TID123');
get
Param | Type |
---|---|
transaction | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede; $transaction = Rede::get('TID123');
getByReference
Param | Type |
---|---|
reference | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede; $transaction = Rede::getByReference('TID123');
getRefunds
Param | Type |
---|---|
transaction | string (required) |
Example:
use lucasgiovanny\ERede\Facades\Rede; $transaction = Rede::getRefunds('TID123');
To do List
- Tests
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Test needs to be written. Feel free to collaborate.
Security
If you discover any security related issues, please email lucasgiovanny@gmail.com instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.