Compare commits
No commits in common. "82c73dc0e128adcea7d6f8ff26eaf88fb17b9665" and "d9090d3bf88504b6f293cfe36d1d52f717cebc01" have entirely different histories.
82c73dc0e1
...
d9090d3bf8
|
@ -32,8 +32,4 @@ NANO_SANTE_SERVICE_NAME=nanoSanteService
|
|||
NANO_SANTE_SERVICE_BASE_URL= http://localhost:8086
|
||||
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
|
||||
|
|
|
@ -12,7 +12,6 @@ use Illuminate\Http\Response;
|
|||
use Illuminate\Validation\ValidationException;
|
||||
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
|
||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||
use Symfony\Component\HttpFoundation\Response as ResponseAlias;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Throwable;
|
||||
|
||||
|
@ -71,7 +70,7 @@ class Handler extends ExceptionHandler
|
|||
$model = strtolower(class_basename($exception->getModel()));
|
||||
|
||||
return $this->errorResponse(trans('errors.model_not_found',['model'=>$model]),
|
||||
ResponseAlias::HTTP_NOT_FOUND);
|
||||
Response::HTTP_NOT_FOUND);
|
||||
}
|
||||
|
||||
if($exception instanceof AuthorizationException)
|
||||
|
@ -83,7 +82,7 @@ class Handler extends ExceptionHandler
|
|||
{
|
||||
$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)
|
||||
|
@ -100,21 +99,17 @@ class Handler extends ExceptionHandler
|
|||
|
||||
if($exception instanceof AuthenticationException)
|
||||
{
|
||||
return $this->errorResponse($exception->getMessage(), ResponseAlias::HTTP_UNAUTHORIZED);
|
||||
return $this->errorResponse($exception->getMessage(),Response::HTTP_UNAUTHORIZED);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
$errorBody = $exception->getResponse()->getBody()->getContents();
|
||||
$error = json_decode($errorBody);
|
||||
$message = $error?->error ?? $exception->getMessage();
|
||||
$code = $error?->status ?? ResponseAlias::HTTP_INTERNAL_SERVER_ERROR;
|
||||
return $this->errorResponse($message,$code);
|
||||
return $this->errorResponse($exception->getMessage(),Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
if( env('APP_DEBUG', false))
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
return $this->successResponse($this->nanoSanteService->post(
|
||||
|
|
|
@ -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()
|
||||
));
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
));
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -61,10 +61,10 @@ trait ConsumesExternalService
|
|||
foreach ($body as $key => $value) {
|
||||
if(is_array($value)){
|
||||
foreach ($value as $v){
|
||||
$multipart[] = $this->convertToMultiFormArray($key . '[]', $v);
|
||||
array_push($multipart, $this->convertToMultiFormArray($key.'[]',$v));
|
||||
}
|
||||
}else{
|
||||
$multipart[] = $this->convertToMultiFormArray($key, $value);
|
||||
array_push($multipart, $this->convertToMultiFormArray($key,$value));
|
||||
}
|
||||
}
|
||||
return $multipart;
|
||||
|
|
|
@ -115,7 +115,6 @@ $app->register(App\Providers\AuthServiceProvider::class);
|
|||
//$app->register(SMartins\PassportMultiauth\Providers\MultiauthServiceProvider::class);
|
||||
$app->register(Laravel\Passport\PassportServiceProvider::class);
|
||||
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
|
||||
$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
"license": "MIT",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
"ext-json": "*",
|
||||
"php": "^7.3|^8.0",
|
||||
"dusterio/lumen-passport": "^0.3.0",
|
||||
"flipbox/lumen-generator": "^9.2",
|
||||
"guzzlehttp/guzzle": "^7.3",
|
||||
"laravel/lumen-framework": "^8.0"
|
||||
"laravel/lumen-framework": "^8.0",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"fzaninotto/faker": "^1.9.1",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,13 +21,5 @@ return [
|
|||
'name' => env('NANO_SANTE_SERVICE_NAME'),
|
||||
'base_uri' => env('NANO_SANTE_SERVICE_BASE_URL'),
|
||||
'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'),
|
||||
]
|
||||
];
|
||||
|
|
|
@ -179,8 +179,6 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
|
|||
// QRCode for users
|
||||
$router->get('qrcode/read', '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
|
||||
*/
|
||||
$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){
|
||||
// Insurances routes
|
||||
|
@ -228,12 +226,6 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
|
|||
$router->put('{id}/pay', 'NanoSanteServiceController@put');
|
||||
$router->get('', 'NanoSanteServiceController@get');
|
||||
});
|
||||
|
||||
// Factures
|
||||
$router->group(['prefix' => '/invoices'], function () use ($router) {
|
||||
$router->get('', 'NanoSanteServiceController@get');
|
||||
$router->put('{id}/pay', 'NanoSanteServiceController@put');
|
||||
});
|
||||
});
|
||||
|
||||
// Insurances routes
|
||||
|
@ -248,7 +240,6 @@ $router->get('/geocode', 'HelperController@getGoogleGeocoding');
|
|||
$router->get('acts', '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->post('health-care-sheets/performances-amount', '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->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');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue