lucasgiovanny/laravel-erede

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v2.0.0) of this package.

Laravel Service Provider to use eRede PHP SDK

v2.0.0 2022-05-27 09:19 UTC

This package is auto-updated.

Last update: 2023-03-24 11:55:44 UTC


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

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.