+ Begin Swagger documentation

+ Receive payment from transmitter network
This commit is contained in:
Djery-Tom 2020-10-29 20:22:55 +01:00
parent 042f17791f
commit a042f99199
16 changed files with 972 additions and 13 deletions

View File

@ -37,3 +37,6 @@ VISA_API_PASSWORD=PasswordHere!
NOTIFICATION_SERVICE_URL=localhost:8083
NOTIFICATION_SERVICE_KEY=RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg
SWAGGER_GENERATE_ALWAYS=true
SWAGGER_DOCS_TOKEN=<some_strong_token>

3
.gitignore vendored
View File

@ -4,3 +4,6 @@ Homestead.json
Homestead.yaml
.env
.phpunit.result.cache
/resources/views/vendor
/storage/api-docs
/public/swagger-ui-assets

View File

@ -4,6 +4,16 @@ namespace App\Http\Controllers;
use Laravel\Lumen\Routing\Controller as BaseController;
/**
* @OA\Info(
* title="Your Awesome Modules's API",
* version="1.0.0",
* @OA\Contact(
* email="developers@module.com",
* name="Developer Team"
* )
* )
*/
class Controller extends BaseController
{
//

View File

@ -0,0 +1,180 @@
<?php
namespace App\Http\Controllers;
use App\Models\ConfigWallet;
use App\Models\TransmittedIlinkTransaction;
use App\Models\TransmittingNetwork;
use App\Models\User;
use App\Models\WalletsUser;
use App\Traits\ApiResponser;
use App\Traits\Helper;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
// We can define the User Scheme here or in our App\User model
/**
* @OA\Schema(
* schema="UserSchema",
* title="User Model",
* description="User model",
* @OA\Property(
* property="id", description="ID of the user",
* @OA\Schema(type="number", example=1)
* ),
* @OA\Property(
* property="name", description="Name of the user",
* @OA\Schema(type="string", example="User Name")
* )
* )
*/
// We can define the request parameter inside the Requests or here
/**
* @OA\Parameter(
* parameter="get_users_request_parameter_limit",
* name="limit",
* description="Limit the number of results",
* in="query",
* @OA\Schema(
* type="number", default=10
* )
* ),
*/
class TransmittingNetworksController extends Controller
{
use ApiResponser;
use Helper;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* @OA\Get(
* path="/users",
* summary="Return the list of users",
* tags={"Hello"},
* @OA\Parameter(ref="#/components/parameters/get_users_request_parameter_limit"),
* @OA\Response(
* response=200,
* description="List of users",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* description="List of users",
* @OA\Schema(
* type="array",
* @OA\Items(ref="#/components/schemas/UserSchema")
* )
* )
* )
* )
* )
*/
public function index(Request $request)
{
$users = User::paginate($request->get("limit", 10));
return ["data" => $users];
}
public function receivePayment(Request $request)
{
$this->validate($request, [
'type' => 'required|integer|in:1,3,17', // Les types de transactions possibles à recevoir [1,3,17]
'montant' => 'required|numeric|min:0|not_in:0',
'network_emetteur' => 'required|numeric|min:0|not_in:0',
'network_destinataire' => 'required|numeric|min:0|not_in:0',
'id_transaction_network_emetteur' => 'required',
]);
$configRecipient = ConfigWallet::where('id_network', $request->network_destinataire)->first();
$configTransmitter = ConfigWallet::where('id_network', $request->network_emetteur)->first();
if (!$configRecipient)
return $this->errorResponse("Ce reseau destinataire n'est pas configuré dans notre systeme");
if ($configRecipient->type != 'ilink')
return $this->errorResponse("Ce reseau destinataire n'est pas autorise à recevoir des transactions dans notre systeme");
if (!$configTransmitter)
return $this->errorResponse("Ce reseau emetteur n'est pas configuré dans notre systeme");
if ($configTransmitter->type != 'autre')
return $this->errorResponse("Ce reseau emetteur n'est pas autorise à recevoir des transactions dans notre systeme");
$transmittingNetwork = TransmittingNetwork::where('id_network', $request->network_emetteur)->where('id_configWallet', $configRecipient->id)->first();
if (!$transmittingNetwork)
return $this->errorResponse("Ce reseau n'est pas reconnu comme etant un reseau emetteur du reseau destinataire");
$transaction = new TransmittedIlinkTransaction();
$transaction->fill($request->all());
$transaction->id_transaction = $this->getTransactionID();
switch ($request->type) {
case 1:
$this->validate($request, [
'id_destinataire' => 'required',
'nom_emetteur' => 'required',
'prenom_emetteur' => 'required',
'email_emetteur' => 'required',
'type_document_emetteur' => 'required',
'id_document_emetteur' => 'required',
'id_emetteur' => 'required',
]);
$user = User::where('user_code', $request->id_destinataire)->firstOrFail();
$wallet_user = WalletsUser::where('idUser', $user->id)->firstOrFail();
// Verifier si le wallet destinataire appartient au meme pays que le reseau
$wallet_user->balance += $request->montant;
$wallet_user->save();
$transmittingNetwork->balance_compensation += $request->montant;
$transmittingNetwork->save();
$transaction->save();
$message = trans('messages.wallet_incoming_payment_message',
['amount' => $this->toMoneyWithNetwork($request->montant, $request->id), 'transmitter' => $request->nom_emetteur . ' ' . $request->prenom_emetteur]);
$this->sendMail($user->email, trans('messages.wallet_incoming_payment'), $message);
return $this->successResponse(trans('messages.success_treated_demand'));
break;
case 2:
$this->validate($request, [
'nom_emetteur' => 'required',
'prenom_emetteur' => 'required',
'type_document_emetteur' => 'required',
'id_document_emetteur' => 'required',
'email_emetteur' => 'required',
'nom_destinataire' => 'required',
'prenom_destinataire' => 'required',
'type_document_destinataire' => 'required',
]);
return $this->successResponse(trans('messages.success_treated_demand'));
break;
case 17:
return $this->successResponse(trans('messages.success_treated_demand'));
break;
}
}
private function getTransactionID()
{
do {
$code = $this->generateTransactionCode();
$result = collect(DB::select('SELECT * FROM transmitted_ilink_transaction WHERE id_transaction = :code', ['code' => $code]));
$codeCorrect = sizeof($result) < 0;
} while ($codeCorrect);
return $code;
}
}

View File

@ -1353,15 +1353,6 @@ class iLinkTransactionController extends Controller
return $code;
}
private function generateTransactionCode($length = 12) {
$characters = '23456789ABCDEFGHJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
private function checkUserIdentification($id_user){
$identification = Identification::where('id_user', $id_user)->first();

View File

@ -0,0 +1,34 @@
<?php
namespace App\Http\Middleware;
use Closure;
class SecureApiDocs
{
public function handle($request, Closure $next)
{
// for local, dont add any authentication
if (env('APP_ENV') === 'local') {
return $next($request);
}
$token = $request->get('token');
if (!$token) {
// try to load the token from referer
$query = array();
parse_str(
parse_url($request->header('referer'), PHP_URL_QUERY),
$query
);
if (isset($query['token'])) {
$token = $query['token'];
}
}
// we will match it against the `SWAGGER_DOCS_TOKEN` environment variable
if ($token === env('SWAGGER_DOCS_TOKEN')) {
return $next($request);
} else {
return abort(403);
}
}
}

View File

@ -0,0 +1,69 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class TransmittedIlinkTransaction
*
* @property int $id
* @property string $id_transaction
* @property string $id_transaction_network_emetteur
* @property int $network_destinataire
* @property int $network_emetteur
* @property float $montant
* @property int $id_destinataire
* @property string|null $nom_destinataire
* @property string|null $prenom_destinataire
* @property string|null $type_document_destinataire
* @property string|null $id_document_destinataire
* @property string|null $email_destinataire
* @property string|null $id_emetteur
* @property string|null $nom_emetteur
* @property string|null $prenom_emetteur
* @property string|null $type_document_emetteur
* @property string|null $id_document_emetteur
* @property string|null $email_emetteur
* @property int $type
*
* @package App\Models
*/
class TransmittedIlinkTransaction extends Model
{
protected $table = 'transmitted_ilink_transaction';
public $timestamps = false;
protected $casts = [
'network_destinataire' => 'int',
'network_emetteur' => 'int',
'montant' => 'float',
'id_destinataire' => 'int',
'type' => 'int'
];
protected $fillable = [
'id_transaction',
'id_transaction_network_emetteur',
'network_destinataire',
'network_emetteur',
'montant',
'id_destinataire',
'nom_destinataire',
'prenom_destinataire',
'type_document_destinataire',
'id_document_destinataire',
'email_destinataire',
'id_emetteur',
'nom_emetteur',
'prenom_emetteur',
'type_document_emetteur',
'id_document_emetteur',
'email_emetteur',
'type'
];
}

View File

@ -0,0 +1,53 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Class TransmittingNetwork
*
* @property int $id
* @property int|null $id_network
* @property float $balance_compensation
* @property float|null $balance_com
* @property int|null $id_configWallet
*
* @property Network $network
* @property ConfigWallet $config_wallet
*
* @package App\Models
*/
class TransmittingNetwork extends Model
{
protected $table = 'transmitting_networks';
public $timestamps = false;
protected $casts = [
'id_network' => 'int',
'balance_compensation' => 'float',
'balance_com' => 'float',
'id_configWallet' => 'int'
];
protected $fillable = [
'id_network',
'balance_compensation',
'balance_com',
'id_configWallet'
];
public function network()
{
return $this->belongsTo(Network::class, 'id_network');
}
public function config_wallet()
{
return $this->belongsTo(ConfigWallet::class, 'id_configWallet');
}
}

View File

@ -270,6 +270,17 @@ trait Helper
return $randomString;
}
public function generateTransactionCode($length = 12)
{
$characters = '23456789ABCDEFGHJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
// Fonction de tri par date
public function sortFunction($a, $b)
{

View File

@ -65,6 +65,8 @@ $app->configure('queue');
$app->alias('mailer', Illuminate\Mail\Mailer::class);
$app->alias('mailer', Illuminate\Contracts\Mail\Mailer::class);
$app->alias('mailer', Illuminate\Contracts\Mail\MailQueue::class);
$app->configure('swagger-lume');
$app->register(\SwaggerLume\ServiceProvider::class);
/*
|--------------------------------------------------------------------------
@ -82,9 +84,10 @@ $app->alias('mailer', Illuminate\Contracts\Mail\MailQueue::class);
App\Http\Middleware\AuthenticateAccess::class
]);
// $app->routeMiddleware([
$app->routeMiddleware([
// 'auth' => App\Http\Middleware\Authenticate::class,
// ]);
'docs' => App\Http\Middleware\SecureApiDocs::class,
]);
/*
|--------------------------------------------------------------------------

View File

@ -7,6 +7,7 @@
"require": {
"php": "^7.2.5",
"brick/money": "^0.4.5",
"darkaonline/swagger-lume": "^8.0",
"guzzlehttp/guzzle": "^6.5",
"illuminate/mail": "^7.13",
"laravel/lumen-framework": "^7.0",
@ -41,6 +42,9 @@
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-install-cmd": [
"cp -a vendor/swagger-api/swagger-ui/dist public/swagger-ui-assets"
]
}
}

393
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5adcfbb33de444fa415816ca02cd157e",
"content-hash": "e063e96c1e5f2bbfdd2eb30dc69a49fc",
"packages": [
{
"name": "brick/math",
@ -103,6 +103,137 @@
],
"time": "2020-05-31T14:17:02+00:00"
},
{
"name": "darkaonline/swagger-lume",
"version": "8.0",
"source": {
"type": "git",
"url": "https://github.com/DarkaOnLine/SwaggerLume.git",
"reference": "5ee548ccaf487b4561880eb9741975dad3c3dd1a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DarkaOnLine/SwaggerLume/zipball/5ee548ccaf487b4561880eb9741975dad3c3dd1a",
"reference": "5ee548ccaf487b4561880eb9741975dad3c3dd1a",
"shasum": ""
},
"require": {
"laravel/lumen-framework": "~6.0|~7.0|^8.0",
"php": ">=7.2",
"swagger-api/swagger-ui": "^3.0",
"zircote/swagger-php": "~2.0|3.*"
},
"require-dev": {
"fzaninotto/faker": "~1.8",
"mockery/mockery": "1.*",
"phpunit/phpunit": "8.*",
"satooshi/php-coveralls": "^2.0",
"vlucas/phpdotenv": "~3.3|~4.0"
},
"type": "library",
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"SwaggerLume\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Darius Matulionis",
"email": "darius@matulionis.lt"
}
],
"description": "Swagger integration to Lumen 5",
"keywords": [
"laravel",
"lumen",
"swagger"
],
"funding": [
{
"url": "https://github.com/DarkaOnLine",
"type": "github"
}
],
"time": "2020-09-25T10:41:43+00:00"
},
{
"name": "doctrine/annotations",
"version": "1.11.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad",
"reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad",
"shasum": ""
},
"require": {
"doctrine/lexer": "1.*",
"ext-tokenizer": "*",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/cache": "1.*",
"doctrine/coding-standard": "^6.0 || ^8.1",
"phpstan/phpstan": "^0.12.20",
"phpunit/phpunit": "^7.5 || ^9.1.5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.11.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
"homepage": "https://www.doctrine-project.org/projects/annotations.html",
"keywords": [
"annotations",
"docblock",
"parser"
],
"time": "2020-10-26T10:28:16+00:00"
},
{
"name": "doctrine/inflector",
"version": "1.3.1",
@ -2723,6 +2854,63 @@
],
"time": "2020-03-29T20:13:32+00:00"
},
{
"name": "swagger-api/swagger-ui",
"version": "v3.36.0",
"source": {
"type": "git",
"url": "https://github.com/swagger-api/swagger-ui.git",
"reference": "b9915b112821eca7bd99926787fbe38b91204d5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/b9915b112821eca7bd99926787fbe38b91204d5d",
"reference": "b9915b112821eca7bd99926787fbe38b91204d5d",
"shasum": ""
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Anna Bodnia",
"email": "anna.bodnia@gmail.com"
},
{
"name": "Buu Nguyen",
"email": "buunguyen@gmail.com"
},
{
"name": "Josh Ponelat",
"email": "jponelat@gmail.com"
},
{
"name": "Kyle Shockey",
"email": "kyleshockey1@gmail.com"
},
{
"name": "Robert Barnwell",
"email": "robert@robertismy.name"
},
{
"name": "Sahar Jafari",
"email": "shr.jafari@gmail.com"
}
],
"description": " Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.",
"homepage": "http://swagger.io",
"keywords": [
"api",
"documentation",
"openapi",
"specification",
"swagger",
"ui"
],
"time": "2020-10-22T17:41:54+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.2.3",
@ -2928,6 +3116,70 @@
],
"time": "2020-03-27T16:56:45+00:00"
},
{
"name": "symfony/deprecation-contracts",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"files": [
"function.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-07T11:33:47+00:00"
},
{
"name": "symfony/error-handler",
"version": "v5.0.7",
@ -4086,6 +4338,78 @@
],
"time": "2020-03-27T16:56:45+00:00"
},
{
"name": "symfony/yaml",
"version": "v5.1.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "f284e032c3cefefb9943792132251b79a6127ca6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6",
"reference": "f284e032c3cefefb9943792132251b79a6127ca6",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-ctype": "~1.8"
},
"conflict": {
"symfony/console": "<4.4"
},
"require-dev": {
"symfony/console": "^4.4|^5.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
},
"bin": [
"Resources/bin/yaml-lint"
],
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-24T12:03:25+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
"version": "2.2.2",
@ -4297,6 +4621,73 @@
"php"
],
"time": "2020-03-13T01:23:26+00:00"
},
{
"name": "zircote/swagger-php",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/zircote/swagger-php.git",
"reference": "9d172471e56433b5c7061006b9a766f262a3edfd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zircote/swagger-php/zipball/9d172471e56433b5c7061006b9a766f262a3edfd",
"reference": "9d172471e56433b5c7061006b9a766f262a3edfd",
"shasum": ""
},
"require": {
"doctrine/annotations": "*",
"ext-json": "*",
"php": ">=7.2",
"symfony/finder": ">=2.2",
"symfony/yaml": ">=3.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"phpunit/phpunit": ">=8"
},
"bin": [
"bin/openapi"
],
"type": "library",
"autoload": {
"psr-4": {
"OpenApi\\": "src"
},
"files": [
"src/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Robert Allen",
"email": "zircote@gmail.com"
},
{
"name": "Bob Fanger",
"email": "bfanger@gmail.com",
"homepage": "https://bfanger.nl"
},
{
"name": "Martin Rademacher",
"email": "mano@radebatz.net",
"homepage": "https://radebatz.net"
}
],
"description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations",
"homepage": "https://github.com/zircote/swagger-php/",
"keywords": [
"api",
"json",
"rest",
"service discovery"
],
"time": "2020-09-03T20:18:43+00:00"
}
],
"packages-dev": [

204
config/swagger-lume.php Normal file
View File

@ -0,0 +1,204 @@
<?php
return [
'api' => [
/*
|--------------------------------------------------------------------------
| Edit to set the api's title
|--------------------------------------------------------------------------
*/
'title' => 'iLink APP API',
],
'routes' => [
/*
|--------------------------------------------------------------------------
| Route for accessing api documentation interface
|--------------------------------------------------------------------------
*/
'api' => '/api/documentation',
/*
|--------------------------------------------------------------------------
| Route for accessing parsed swagger annotations.
|--------------------------------------------------------------------------
*/
'docs' => '/docs',
/*
|--------------------------------------------------------------------------
| Route for Oauth2 authentication callback.
|--------------------------------------------------------------------------
*/
'oauth2_callback' => '/api/oauth2-callback',
/*
|--------------------------------------------------------------------------
| Route for serving assets
|--------------------------------------------------------------------------
*/
'assets' => '/swagger-ui-assets',
/*
|--------------------------------------------------------------------------
| Middleware allows to prevent unexpected access to API documentation
|--------------------------------------------------------------------------
*/
'middleware' => [
'api' => ['docs'],
'asset' => [],
'docs' => ['docs'],
'oauth2_callback' => [],
],
],
'paths' => [
/*
|--------------------------------------------------------------------------
| Absolute path to location where parsed swagger annotations will be stored
|--------------------------------------------------------------------------
*/
'docs' => storage_path('api-docs'),
/*
|--------------------------------------------------------------------------
| File name of the generated json documentation file
|--------------------------------------------------------------------------
*/
'docs_json' => 'api-docs.json',
/*
|--------------------------------------------------------------------------
| Absolute path to directory containing the swagger annotations are stored.
|--------------------------------------------------------------------------
*/
'annotations' => base_path('app'),
/*
|--------------------------------------------------------------------------
| Absolute path to directories that you would like to exclude from swagger generation
|--------------------------------------------------------------------------
*/
'excludes' => [],
/*
|--------------------------------------------------------------------------
| Edit to set the swagger scan base path
|--------------------------------------------------------------------------
*/
'base' => env('L5_SWAGGER_BASE_PATH', null),
/*
|--------------------------------------------------------------------------
| Absolute path to directory where to export views
|--------------------------------------------------------------------------
*/
'views' => base_path('resources/views/vendor/swagger-lume'),
],
/*
|--------------------------------------------------------------------------
| API security definitions. Will be generated into documentation file.
|--------------------------------------------------------------------------
*/
'security' => [
/*
|--------------------------------------------------------------------------
| Examples of Security definitions
|--------------------------------------------------------------------------
*/
/*
'api_key_security_example' => [ // Unique name of security
'type' => 'apiKey', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
'description' => 'A short description for security scheme',
'name' => 'api_key', // The name of the header or query parameter to be used.
'in' => 'header', // The location of the API key. Valid values are "query" or "header".
],
'oauth2_security_example' => [ // Unique name of security
'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
'description' => 'A short description for oauth2 security scheme.',
'flow' => 'implicit', // The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode".
'authorizationUrl' => 'http://example.com/auth', // The authorization URL to be used for (implicit/accessCode)
//'tokenUrl' => 'http://example.com/auth' // The authorization URL to be used for (password/application/accessCode)
'scopes' => [
'read:projects' => 'read your projects',
'write:projects' => 'modify projects in your account',
]
],*/
/* Open API 3.0 support
'passport' => [ // Unique name of security
'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
'description' => 'Laravel passport oauth2 security.',
'in' => 'header',
'scheme' => 'https',
'flows' => [
"password" => [
"authorizationUrl" => config('app.url') . '/oauth/authorize',
"tokenUrl" => config('app.url') . '/oauth/token',
"refreshUrl" => config('app.url') . '/token/refresh',
"scopes" => []
],
],
],
*/
],
/*
|--------------------------------------------------------------------------
| Turn this off to remove swagger generation on production
|--------------------------------------------------------------------------
*/
'generate_always' => env('SWAGGER_GENERATE_ALWAYS', false),
/*
|--------------------------------------------------------------------------
| Edit to set the swagger version number
|--------------------------------------------------------------------------
*/
'swagger_version' => env('SWAGGER_VERSION', '3.0'),
/*
|--------------------------------------------------------------------------
| Edit to trust the proxy's ip address - needed for AWS Load Balancer
|--------------------------------------------------------------------------
*/
'proxy' => false,
/*
|--------------------------------------------------------------------------
| Configs plugin allows to fetch external configs instead of passing them to SwaggerUIBundle.
| See more at: https://github.com/swagger-api/swagger-ui#configs-plugin
|--------------------------------------------------------------------------
*/
'additional_config_url' => null,
/*
|--------------------------------------------------------------------------
| Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically),
| 'method' (sort by HTTP method).
| Default is the order returned by the server unchanged.
|--------------------------------------------------------------------------
*/
'operations_sort' => env('L5_SWAGGER_OPERATIONS_SORT', null),
/*
|--------------------------------------------------------------------------
| Uncomment to pass the validatorUrl parameter to SwaggerUi init on the JS
| side. A null value here disables validation.
|--------------------------------------------------------------------------
*/
'validator_url' => null,
/*
|--------------------------------------------------------------------------
| Uncomment to add constants which can be used in anotations
|--------------------------------------------------------------------------
*/
'constants' => [
// 'SWAGGER_LUME_CONST_HOST' => env('SWAGGER_LUME_CONST_HOST', 'http://my-default-host.com'),
],
];

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -248,5 +248,7 @@ Informations sur l'epargne :
"reload_your_account" => "Le remboursement de nano credit a echoué pour solde insuffisant, veuillez recharger votre compte.",
"successful_password_update" => "Votre mot de passe a été mis à jour avec succès.",
"your_new_password" => "Votre nouveau mot de passe est :password.",
"password_update" => "Mise à jour de votre mot de passe"
"password_update" => "Mise à jour de votre mot de passe",
"wallet_incoming_payment" => "Paiement entrant dans votre portefeuille",
"wallet_incoming_payment_message" => "Vous avez recu un paiement de :amount , venant de :transmitter",
];

View File

@ -15,6 +15,7 @@
// return $router->app->version();
//});
// Helper routes
$router->post('receivePayment', 'TransmittingNetworksController@receivePayment');
$router->post('update_password', 'UserController@updatePassword');
$router->get('agent_codes/{agent_code}', 'HelperController@agentCodes');
$router->get('countries', 'HelperController@countries');