Compare commits

..

No commits in common. "82c73dc0e128adcea7d6f8ff26eaf88fb17b9665" and "d9090d3bf88504b6f293cfe36d1d52f717cebc01" have entirely different histories.

12 changed files with 1434 additions and 1807 deletions

View File

@ -18,22 +18,18 @@ DB_PASSWORD=vps@2017GA
CACHE_DRIVER=file CACHE_DRIVER=file
QUEUE_CONNECTION=sync QUEUE_CONNECTION=sync
MOBILEBACKEND_BASE_URL=https://ilink-app.com MOBILEBACKEND_BASE_URL =https://ilink-app.com
MOBILEBACKENDTEST_BASE_URL=http://test.ilink-app.com:8080 MOBILEBACKENDTEST_BASE_URL=http://test.ilink-app.com:8080
WALLET_SERVICE_BASE_URL=https://ilink-app.com WALLET_SERVICE_BASE_URL =https://ilink-app.com
WALLET_SERVICE_NAME=walletService WALLET_SERVICE_NAME = walletService
WALLET_SERVICE_KEY=yhSTSSqIO1uSE1icu09edPOeSFGxIDjo WALLET_SERVICE_KEY=yhSTSSqIO1uSE1icu09edPOeSFGxIDjo
NOTIFICATION_SERVICE_NAME=notificationService NOTIFICATION_SERVICE_NAME = notificationService
NOTIFICATION_SERVICE_BASE_URL=http://localhost:8083 NOTIFICATION_SERVICE_BASE_URL= http://localhost:8083
NOTIFICATION_SERVICE_KEY=RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg NOTIFICATION_SERVICE_KEY=RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg
NANO_SANTE_SERVICE_NAME=nanoSanteService NANO_SANTE_SERVICE_NAME = nanoSanteService
NANO_SANTE_SERVICE_BASE_URL=http://localhost:8086 NANO_SANTE_SERVICE_BASE_URL= http://localhost:8086
NANO_SANTE_SERVICE_KEY=eStSQIoAfnTJ9nkCs0IJkJiKACxYVcQm NANO_SANTE_SERVICE_KEY=eStSQIoAfnTJ9nkCs0IJkJiKACxYVcQm
PAYMENT_SERVICE_NAME=paymentService
PAYMENT_SERVICE_BASE_URL=http://localhost:8087
PAYMENT_SERVICE_KEY=U14YhuyFhweMeYpIYj8Ft2jm4cVgbMzD
GOOGLE_GEOCODING_API_KEY=AIzaSyAixFlmxSD_IM_X3jaRn0OyhfZK3xJSAAk GOOGLE_GEOCODING_API_KEY=AIzaSyAixFlmxSD_IM_X3jaRn0OyhfZK3xJSAAk

View File

@ -12,7 +12,6 @@ use Illuminate\Http\Response;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler; use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Exception\OAuthServerException;
use Symfony\Component\HttpFoundation\Response as ResponseAlias;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable; use Throwable;
@ -71,7 +70,7 @@ class Handler extends ExceptionHandler
$model = strtolower(class_basename($exception->getModel())); $model = strtolower(class_basename($exception->getModel()));
return $this->errorResponse(trans('errors.model_not_found',['model'=>$model]), return $this->errorResponse(trans('errors.model_not_found',['model'=>$model]),
ResponseAlias::HTTP_NOT_FOUND); Response::HTTP_NOT_FOUND);
} }
if($exception instanceof AuthorizationException) if($exception instanceof AuthorizationException)
@ -83,7 +82,7 @@ class Handler extends ExceptionHandler
{ {
$errors = $exception->validator->errors()->getMessages(); $errors = $exception->validator->errors()->getMessages();
return $this->errorResponse($errors, ResponseAlias::HTTP_UNPROCESSABLE_ENTITY); return $this->errorResponse($errors, Response::HTTP_UNPROCESSABLE_ENTITY);
} }
if ( $exception instanceof ClientException) if ( $exception instanceof ClientException)
@ -100,21 +99,17 @@ class Handler extends ExceptionHandler
if($exception instanceof AuthenticationException) if($exception instanceof AuthenticationException)
{ {
return $this->errorResponse($exception->getMessage(), ResponseAlias::HTTP_UNAUTHORIZED); return $this->errorResponse($exception->getMessage(),Response::HTTP_UNAUTHORIZED);
} }
if ($exception instanceof OAuthServerException) if ($exception instanceof OAuthServerException)
{ {
return $this->errorResponse($exception->getMessage(), ResponseAlias::HTTP_INTERNAL_SERVER_ERROR); return $this->errorResponse($exception->getMessage(),Response::HTTP_INTERNAL_SERVER_ERROR);
} }
if ($exception instanceof ServerException) if ($exception instanceof ServerException)
{ {
$errorBody = $exception->getResponse()->getBody()->getContents(); return $this->errorResponse($exception->getMessage(),Response::HTTP_INTERNAL_SERVER_ERROR);
$error = json_decode($errorBody);
$message = $error?->error ?? $exception->getMessage();
$code = $error?->status ?? ResponseAlias::HTTP_INTERNAL_SERVER_ERROR;
return $this->errorResponse($message,$code);
} }
if( env('APP_DEBUG', false)) if( env('APP_DEBUG', false))

View File

@ -32,13 +32,6 @@ class NanoSanteServiceController extends Controller
)); ));
} }
public function getOriginal(Request $request)
{
return $this->nanoSanteService->get(
substr($request->getRequestUri(),strlen(config('services.nano_sante_service.name'))+1), $request->all(),$request->header()
);
}
public function post(Request $request) public function post(Request $request)
{ {
return $this->successResponse($this->nanoSanteService->post( return $this->successResponse($this->nanoSanteService->post(

View File

@ -1,56 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Services\NotificationService;
use App\Services\PaymentService;
use App\Traits\ApiResponser;
use Illuminate\Http\Request;
class PaymentServiceController extends Controller
{
use ApiResponser;
/**
* @var paymentService
*/
public $paymentService;
/**
* Create a new controller instance.
*
* @param PaymentService $service
*/
public function __construct(PaymentService $service)
{
$this->paymentService = $service;
}
public function get(Request $request)
{
return $this->successResponse($this->paymentService->get(
substr($request->getRequestUri(),strlen(env('PAYMENT_SERVICE_NAME'))+1), $request->all(),$request->header()
));
}
public function post(Request $request)
{
return $this->successResponse($this->paymentService->post(
substr($request->getRequestUri(),strlen(env('PAYMENT_SERVICE_NAME'))+1), $request->all(),$request->header()
));
}
public function put(Request $request)
{
return $this->successResponse($this->paymentService->put(
substr($request->getRequestUri(),strlen(env('PAYMENT_SERVICE_NAME'))+1), $request->all(),$request->header()
));
}
public function delete(Request $request)
{
return $this->successResponse($this->paymentService->delete(
substr($request->getRequestUri(),strlen(env('PAYMENT_SERVICE_NAME'))+1), $request->all(),$request->header()
));
}
}

View File

@ -1,62 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Services\WalletService;
use App\Traits\ApiResponser;
use Illuminate\Http\Request;
class SimulatorServiceController extends Controller
{
use ApiResponser;
/**
* @var WalletService
*/
public $walletService;
/**
* Create a new controller instance.
*
* @param WalletService $walletService
*/
public function __construct(WalletService $walletService)
{
$this->walletService = $walletService;
}
public function get(Request $request)
{
return $this->successResponse($this->walletService->get(
substr($request->getRequestUri(),strlen(config('services.simulator_service.name'))+1), $request->all(),$request->header()
));
}
public function post(Request $request)
{
return $this->successResponse($this->walletService->post(
substr($request->getRequestUri(),strlen(config('services.simulator_service.name'))+1), $request->all(),$request->header()
));
}
public function postWithFiles(Request $request)
{
return $this->successResponse($this->walletService->postFiles(
substr($request->getRequestUri(),strlen(config('services.simulator_service.name'))+1), $request->all(),$request->header()
));
}
public function put(Request $request)
{
return $this->successResponse($this->walletService->put(
substr($request->getRequestUri(),strlen(config('services.simulator_service.name'))+1), $request->all(),$request->header()
));
}
public function delete(Request $request)
{
return $this->successResponse($this->walletService->delete(
substr($request->getRequestUri(),strlen(config('services.simulator_service.name'))+1), $request->all(),$request->header()
));
}
}

View File

@ -1,46 +0,0 @@
<?php
namespace App\Services;
use App\Traits\ConsumesExternalService;
class PaymentService
{
use ConsumesExternalService;
/**
* @var string
*/
public $baseUri ;
/**
* @var string
*/
public $key ;
public function __construct()
{
$this->baseUri = config('services.payment_service.base_uri');
$this->key = config('services.payment_service.key');
}
public function post($uri , $data, $headers)
{
return $this->perfomRequest('POST',$uri,$data,$headers);
}
public function get($uri , $data, $headers)
{
return $this->perfomRequest('GET',$uri,$data,$headers);
}
public function put($uri , $data, $headers)
{
return $this->perfomRequest('PUT',$uri,$data,$headers);
}
public function delete($uri , $data, $headers)
{
return $this->perfomRequest('DELETE',$uri,$data,$headers);
}
}

View File

@ -61,10 +61,10 @@ trait ConsumesExternalService
foreach ($body as $key => $value) { foreach ($body as $key => $value) {
if(is_array($value)){ if(is_array($value)){
foreach ($value as $v){ foreach ($value as $v){
$multipart[] = $this->convertToMultiFormArray($key . '[]', $v); array_push($multipart, $this->convertToMultiFormArray($key.'[]',$v));
} }
}else{ }else{
$multipart[] = $this->convertToMultiFormArray($key, $value); array_push($multipart, $this->convertToMultiFormArray($key,$value));
} }
} }
return $multipart; return $multipart;

View File

@ -115,7 +115,6 @@ $app->register(App\Providers\AuthServiceProvider::class);
//$app->register(SMartins\PassportMultiauth\Providers\MultiauthServiceProvider::class); //$app->register(SMartins\PassportMultiauth\Providers\MultiauthServiceProvider::class);
$app->register(Laravel\Passport\PassportServiceProvider::class); $app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class); $app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);
/* /*

View File

@ -5,12 +5,11 @@
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": "^8.0", "php": "^7.3|^8.0",
"ext-json": "*",
"dusterio/lumen-passport": "^0.3.0", "dusterio/lumen-passport": "^0.3.0",
"flipbox/lumen-generator": "^9.2",
"guzzlehttp/guzzle": "^7.3", "guzzlehttp/guzzle": "^7.3",
"laravel/lumen-framework": "^8.0" "laravel/lumen-framework": "^8.0",
"ext-json": "*"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "^1.9.1", "fzaninotto/faker": "^1.9.1",

2986
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -21,13 +21,5 @@ return [
'name' => env('NANO_SANTE_SERVICE_NAME'), 'name' => env('NANO_SANTE_SERVICE_NAME'),
'base_uri' => env('NANO_SANTE_SERVICE_BASE_URL'), 'base_uri' => env('NANO_SANTE_SERVICE_BASE_URL'),
'key'=> env('NANO_SANTE_SERVICE_KEY') 'key'=> env('NANO_SANTE_SERVICE_KEY')
],
'payment_service' => [
'name' => env('PAYMENT_SERVICE_NAME'),
'base_uri' => env('PAYMENT_SERVICE_BASE_URL'),
'key'=> env('PAYMENT_SERVICE_KEY')
],
'simulator_service' => [
'name' => env('SIMULATOR_SERVICE_NAME','simulator'),
] ]
]; ];

View File

@ -179,8 +179,6 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
// QRCode for users // QRCode for users
$router->get('qrcode/read', 'WalletServiceController@get'); $router->get('qrcode/read', 'WalletServiceController@get');
$router->get('qrcode/image', 'WalletServiceController@get'); $router->get('qrcode/image', 'WalletServiceController@get');
//User
$router->post('agents', 'WalletServiceController@post');
}); });
/** /**
@ -205,7 +203,7 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
* Routes for NanoSante Service * Routes for NanoSante Service
*/ */
$router->group(['prefix' => '/'.config('services.nano_sante_service.name')], function () use ($router){ $router->group(['prefix' => '/'.config('services.nano_sante_service.name')], function () use ($router){
// $router->get('pdf-viewer', 'NanoSanteServiceController@getOriginal'); $router->get('pdf-viewer', 'NanoSanteServiceController@get');
$router->group(['middleware' => 'auth:api'], function () use ($router){ $router->group(['middleware' => 'auth:api'], function () use ($router){
// Insurances routes // Insurances routes
@ -228,12 +226,6 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
$router->put('{id}/pay', 'NanoSanteServiceController@put'); $router->put('{id}/pay', 'NanoSanteServiceController@put');
$router->get('', 'NanoSanteServiceController@get'); $router->get('', 'NanoSanteServiceController@get');
}); });
// Factures
$router->group(['prefix' => '/invoices'], function () use ($router) {
$router->get('', 'NanoSanteServiceController@get');
$router->put('{id}/pay', 'NanoSanteServiceController@put');
});
}); });
// Insurances routes // Insurances routes
@ -248,7 +240,6 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
$router->get('acts', 'NanoSanteServiceController@get'); $router->get('acts', 'NanoSanteServiceController@get');
$router->get('health-care-sheets', 'NanoSanteServiceController@get'); $router->get('health-care-sheets', 'NanoSanteServiceController@get');
$router->post('health-care-sheets/check-insurance-coverage-amount', 'NanoSanteServiceController@post');
$router->put('health-care-sheets', 'NanoSanteServiceController@put'); $router->put('health-care-sheets', 'NanoSanteServiceController@put');
$router->post('health-care-sheets/performances-amount', 'NanoSanteServiceController@post'); $router->post('health-care-sheets/performances-amount', 'NanoSanteServiceController@post');
$router->post('health-care-sheets/consultation', 'NanoSanteServiceController@post'); $router->post('health-care-sheets/consultation', 'NanoSanteServiceController@post');
@ -261,25 +252,5 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
$router->get('authorizations-care-requests', 'NanoSanteServiceController@get'); $router->get('authorizations-care-requests', 'NanoSanteServiceController@get');
$router->post('authorizations-care-requests', 'NanoSanteServiceController@post'); $router->post('authorizations-care-requests', 'NanoSanteServiceController@post');
$router->get('exclusions/{network_id}', 'NanoSanteServiceController@get');
$router->post('password-validation', 'NanoSanteServiceController@post');
}); });
}); });
/**
* Routes for Payment Service
*/
$router->group(['prefix' => '/'.config('services.payment_service.name')], function () use ($router){
$router->get('methods', 'PaymentServiceController@get');
});
/**
* Routes for public simulator on website
*/
$router->group(['prefix' => '/simulator'], function () use ($router){
$router->get('countries','SimulatorServiceController@get');
$router->post('paying_networks', 'SimulatorServiceController@post');
$router->post('other_paying_networks', 'SimulatorServiceController@post');
$router->post('transactions/ilink/commission','SimulatorServiceController@post');
});