Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Latest commit

 

History

History
171 lines (107 loc) · 3.48 KB

README.md

File metadata and controls

171 lines (107 loc) · 3.48 KB

eRede API for Laravel

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.