diff --git a/.env.example b/.env.example index b0c5a64..39da784 100755 --- a/.env.example +++ b/.env.example @@ -37,3 +37,6 @@ VISA_API_PASSWORD=PasswordHere! NOTIFICATION_SERVICE_URL=localhost:8083 NOTIFICATION_SERVICE_KEY=RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg + +SWAGGER_GENERATE_ALWAYS=true +SWAGGER_DOCS_TOKEN= diff --git a/.gitignore b/.gitignore index 2896e86..e0d3f9c 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ Homestead.json Homestead.yaml .env .phpunit.result.cache +/resources/views/vendor +/storage/api-docs +/public/swagger-ui-assets diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 0ccb918..2d79694 100755 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -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 { // diff --git a/app/Http/Controllers/TransmittingNetworksController.php b/app/Http/Controllers/TransmittingNetworksController.php new file mode 100755 index 0000000..028389c --- /dev/null +++ b/app/Http/Controllers/TransmittingNetworksController.php @@ -0,0 +1,180 @@ +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; + } + + +} diff --git a/app/Http/Controllers/iLinkTransactionController.php b/app/Http/Controllers/iLinkTransactionController.php index 1dd10bd..4f68ae0 100755 --- a/app/Http/Controllers/iLinkTransactionController.php +++ b/app/Http/Controllers/iLinkTransactionController.php @@ -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(); diff --git a/app/Http/Middleware/SecureApiDocs.php b/app/Http/Middleware/SecureApiDocs.php new file mode 100644 index 0000000..6197566 --- /dev/null +++ b/app/Http/Middleware/SecureApiDocs.php @@ -0,0 +1,34 @@ +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); + } + } +} diff --git a/app/Models/TransmittedIlinkTransaction.php b/app/Models/TransmittedIlinkTransaction.php new file mode 100644 index 0000000..ed0c70a --- /dev/null +++ b/app/Models/TransmittedIlinkTransaction.php @@ -0,0 +1,69 @@ + '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' + ]; +} diff --git a/app/Models/TransmittingNetwork.php b/app/Models/TransmittingNetwork.php new file mode 100644 index 0000000..c092b76 --- /dev/null +++ b/app/Models/TransmittingNetwork.php @@ -0,0 +1,53 @@ + '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'); + } +} diff --git a/app/Traits/Helper.php b/app/Traits/Helper.php index c82195d..6082212 100644 --- a/app/Traits/Helper.php +++ b/app/Traits/Helper.php @@ -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) { diff --git a/bootstrap/app.php b/bootstrap/app.php index 9a58dfe..3ad7314 100755 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -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, +]); /* |-------------------------------------------------------------------------- diff --git a/composer.json b/composer.json index 48c071c..f2af7f2 100755 --- a/composer.json +++ b/composer.json @@ -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" ] } } diff --git a/composer.lock b/composer.lock index bf83d14..0ce951a 100755 --- a/composer.lock +++ b/composer.lock @@ -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": [ diff --git a/config/swagger-lume.php b/config/swagger-lume.php new file mode 100644 index 0000000..9589af0 --- /dev/null +++ b/config/swagger-lume.php @@ -0,0 +1,204 @@ + [ + /* + |-------------------------------------------------------------------------- + | 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'), + ], +]; diff --git a/public/photos/penguin-profile.png b/public/photos/penguin-profile.png new file mode 100644 index 0000000..2fb7315 Binary files /dev/null and b/public/photos/penguin-profile.png differ diff --git a/resources/lang/fr/messages.php b/resources/lang/fr/messages.php index c4a9af3..6ae460b 100755 --- a/resources/lang/fr/messages.php +++ b/resources/lang/fr/messages.php @@ -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", ]; diff --git a/routes/web.php b/routes/web.php index 168f345..d52906a 100755 --- a/routes/web.php +++ b/routes/web.php @@ -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');