Install the latest version with
$ composer require wr2net/desafio-back-end
Copy and Past .env-example to .env
$ php -S localhost:8888
$ composer test
<?php
header('Content-Type: application/json');
include_once __DIR__ . "/vendor/autoload.php";
use Alibin\Common\Initialize\Initialize;
use Alibin\Sales\Sales;
$url = 'https://api-sandbox.fpay.me/';
$credentials = [
'CLIENT_CODE' => 'FC-SB-15',
'CLIENT_KEY' => '6ea297bc5e294666f6738e1d48fa63d2'
];
/*
* This not is required
*/
$params = [
'page' => 0,
'per_page' => 50,
'ref' => null,
'date' => null,
'sale' => null,
];
$connection = (new Initialize())->initialize($url, $credentials);
/*
* Get all sales
*/
echo Sales::getFullSales($connection, $params);
/*
* Cancel a sale
*/
echo Sales::cancelSale($connection, "4443-Tusj-yGXp");
/*
* Reversal a sale
*/
echo Sales::reversalSale($connection, "4443-Tusj-yGXp");
/*
* Get clients with yours documents
*/
echo Sales::clientsSale($connection);
/*
* Get quatas from sales
*/
echo Sales::quotaSales($connection);
exit;
The logs are generated daily.
The file name is the date in the format YYYY-MM-DD.log
$ tail -f storage/logs/2021-03-18.log
- PHP 7.3 or above;
- Monolog
^2.0
; - Carbon
^2.0
; - Guzzle
^7.0
;
Bugs and feature request are tracked on GitHub
Wagner Rigoli da Rosa - wagner@rigolidarosa.com - https://wagner.rigolidarosa.com
Desafio-Back-end is licensed under the MIT License - see the LICENSE file for details