Merge pull request #93 from witelgroup/feature/RoadMaitenaceWebService
create sending webservices to panjereh vahed
This commit is contained in:
18
app/Events/V3/Dashboard/Harim/PaymentExecutedEvent.php
Normal file
18
app/Events/V3/Dashboard/Harim/PaymentExecutedEvent.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Events\V3\Dashboard\Harim;
|
||||||
|
|
||||||
|
use App\Models\Harim;
|
||||||
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
|
class PaymentExecutedEvent
|
||||||
|
{
|
||||||
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new event instance.
|
||||||
|
*/
|
||||||
|
public function __construct(public Harim $harim){}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ use App\Events\V3\Dashboard\Harim\ConfirmGuaranteeLetterNeedEvent;
|
|||||||
use App\Events\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedEvent;
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedEvent;
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
||||||
|
use App\Events\V3\Dashboard\Harim\PaymentExecutedEvent;
|
||||||
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
|
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
|
||||||
use App\Facades\DataTable\DataTableFacade;
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
@@ -183,6 +184,8 @@ class GeneralManagerController extends Controller
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PaymentExecutedEvent::dispatch();
|
||||||
|
|
||||||
return $this->successResponse();
|
return $this->successResponse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,4 +223,9 @@ class RoadMaintenanceStationController extends Controller
|
|||||||
allowedSelects: ['id', 'lat', 'lng', 'status', 'type'],
|
allowedSelects: ['id', 'lat', 'lng', 'status', 'type'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function giveListToFms(): JsonResponse
|
||||||
|
{
|
||||||
|
return $this->successResponse(RahdariPoint::all(['id', 'name', 'lat', 'lng', 'area']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Listeners\V3\Dashboard\Harim;
|
namespace App\Listeners\V3\Dashboard\Harim;
|
||||||
|
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmGuaranteeLetterNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmGuaranteeLetterNeedEvent;
|
||||||
|
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Http\Client\RequestException;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
|
|
||||||
class ConfirmGuaranteeLetterNeedListener implements ShouldQueue
|
class ConfirmGuaranteeLetterNeedListener implements ShouldQueue
|
||||||
{
|
{
|
||||||
@@ -16,38 +16,14 @@ class ConfirmGuaranteeLetterNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public ?string $queue = 'harim';
|
public ?string $queue = 'harim';
|
||||||
|
|
||||||
protected string $url;
|
public function __construct(){}
|
||||||
protected string $password;
|
|
||||||
protected string $username;
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->url = config('harim_web_services.Guarantee_Letter_Need.url');
|
|
||||||
$this->username = config('harim_web_services.Guarantee_Letter_Need.username');
|
|
||||||
$this->password = config('harim_web_services.Guarantee_Letter_Need.password');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RequestException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(ConfirmGuaranteeLetterNeedEvent $event): void
|
public function handle(ConfirmGuaranteeLetterNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||||
{
|
{
|
||||||
$encodedData = openssl_decrypt($event->harim->data);
|
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||||
|
$sendAccessRoadStatusService->run();
|
||||||
$data = [
|
|
||||||
'data' => [
|
|
||||||
'actionId' => $encodedData['actionId'],
|
|
||||||
'ruleId' => $encodedData['ruleId'],
|
|
||||||
'activityId' => $encodedData['activityId'],
|
|
||||||
'requestId' => $encodedData['requestId'],
|
|
||||||
'taskId' => $encodedData['taskId'],
|
|
||||||
'code' => $encodedData['code'],
|
|
||||||
'warrantStatus' => $encodedData['warrantStatus'],
|
|
||||||
'amountPaid' => $encodedData['amountPaid'],
|
|
||||||
],
|
|
||||||
'token' => $encodedData['token']
|
|
||||||
];
|
|
||||||
|
|
||||||
Http::post($this->url, json_encode($data))->throw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Listeners\V3\Dashboard\Harim;
|
namespace App\Listeners\V3\Dashboard\Harim;
|
||||||
|
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedEvent;
|
||||||
|
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Http\Client\RequestException;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
|
|
||||||
class ConfirmNoRoadAccessNeedListener implements ShouldQueue
|
class ConfirmNoRoadAccessNeedListener implements ShouldQueue
|
||||||
{
|
{
|
||||||
@@ -16,38 +16,14 @@ class ConfirmNoRoadAccessNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public ?string $queue = 'harim';
|
public ?string $queue = 'harim';
|
||||||
|
|
||||||
protected string $url;
|
public function __construct(){}
|
||||||
protected string $password;
|
|
||||||
protected string $username;
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->url = config('harim_web_services.No_Need_Access.url');
|
|
||||||
$this->username = config('harim_web_services.No_Need_Access.username');
|
|
||||||
$this->password = config('harim_web_services.No_Need_Access.password');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RequestException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(ConfirmNoRoadAccessNeedEvent $event): void
|
public function handle(ConfirmNoRoadAccessNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||||
{
|
{
|
||||||
$encodedData = openssl_decrypt($event->harim->data);
|
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||||
|
$sendAccessRoadStatusService->run();
|
||||||
$data = [
|
|
||||||
'data' => [
|
|
||||||
'actionId' => $encodedData['actionId'],
|
|
||||||
'ruleId' => $encodedData['ruleId'],
|
|
||||||
'activityId' => $encodedData['activityId'],
|
|
||||||
'requestId' => $encodedData['requestId'],
|
|
||||||
'taskId' => $encodedData['taskId'],
|
|
||||||
'code' => $encodedData['code'],
|
|
||||||
'resultStatus' => $encodedData['resultStatus'],
|
|
||||||
'Description' => $encodedData['Description'],
|
|
||||||
],
|
|
||||||
'token' => $encodedData['token']
|
|
||||||
];
|
|
||||||
|
|
||||||
Http::post($this->url, json_encode($data))->throw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Listeners\V3\Dashboard\Harim;
|
namespace App\Listeners\V3\Dashboard\Harim;
|
||||||
|
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedEvent;
|
||||||
|
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Http\Client\RequestException;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
|
|
||||||
class ConfirmRoadAccessEditNeedListener implements ShouldQueue
|
class ConfirmRoadAccessEditNeedListener implements ShouldQueue
|
||||||
{
|
{
|
||||||
@@ -16,38 +16,14 @@ class ConfirmRoadAccessEditNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public ?string $queue = 'harim';
|
public ?string $queue = 'harim';
|
||||||
|
|
||||||
protected string $url;
|
public function __construct(){}
|
||||||
protected string $password;
|
|
||||||
protected string $username;
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->url = config('harim_web_services.Edit_Need_Access.url');
|
|
||||||
$this->username = config('harim_web_services.Edit_Need_Access.username');
|
|
||||||
$this->password = config('harim_web_services.Edit_Need_Access.password');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RequestException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(ConfirmRoadAccessEditNeedEvent $event): void
|
public function handle(ConfirmRoadAccessEditNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||||
{
|
{
|
||||||
$encodedData = openssl_decrypt($event->harim->data);
|
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||||
|
$sendAccessRoadStatusService->run();
|
||||||
$data = [
|
|
||||||
'data' => [
|
|
||||||
'actionId' => $encodedData['actionId'],
|
|
||||||
'ruleId' => $encodedData['ruleId'],
|
|
||||||
'activityId' => $encodedData['activityId'],
|
|
||||||
'requestId' => $encodedData['requestId'],
|
|
||||||
'taskId' => $encodedData['taskId'],
|
|
||||||
'code' => $encodedData['code'],
|
|
||||||
'resultStatus' => $encodedData['resultStatus'],
|
|
||||||
'Description' => $encodedData['Description'],
|
|
||||||
],
|
|
||||||
'token' => $encodedData['token']
|
|
||||||
];
|
|
||||||
|
|
||||||
Http::post($this->url, json_encode($data))->throw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Listeners\V3\Dashboard\Harim;
|
namespace App\Listeners\V3\Dashboard\Harim;
|
||||||
|
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
||||||
|
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Http\Client\RequestException;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
|
|
||||||
class ConfirmRoadAccessNeedListener implements ShouldQueue
|
class ConfirmRoadAccessNeedListener implements ShouldQueue
|
||||||
{
|
{
|
||||||
@@ -16,40 +16,16 @@ class ConfirmRoadAccessNeedListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public ?string $queue = 'harim';
|
public ?string $queue = 'harim';
|
||||||
|
|
||||||
protected string $url;
|
public function __construct(){}
|
||||||
protected string $password;
|
|
||||||
protected string $username;
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->url = config('harim_web_services.Need_Access.url');
|
|
||||||
$this->username = config('harim_web_services.Need_Access.username');
|
|
||||||
$this->password = config('harim_web_services.Need_Access.password');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the event.
|
* Handle the event.
|
||||||
* @throws RequestException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(ConfirmRoadAccessNeedEvent $event): void
|
public function handle(ConfirmRoadAccessNeedEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||||
{
|
{
|
||||||
$encodedData = openssl_decrypt($event->harim->data);
|
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||||
|
$sendAccessRoadStatusService->run();
|
||||||
$data = [
|
|
||||||
'data' => [
|
|
||||||
'actionId' => $encodedData['actionId'],
|
|
||||||
'ruleId' => $encodedData['ruleId'],
|
|
||||||
'activityId' => $encodedData['activityId'],
|
|
||||||
'requestId' => $encodedData['requestId'],
|
|
||||||
'taskId' => $encodedData['taskId'],
|
|
||||||
'code' => $encodedData['code'],
|
|
||||||
'resultStatus' => $encodedData['resultStatus'],
|
|
||||||
'Description' => $encodedData['Description'],
|
|
||||||
],
|
|
||||||
'token' => $encodedData['token']
|
|
||||||
];
|
|
||||||
|
|
||||||
Http::post($this->url, json_encode($data))->throw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
app/Listeners/V3/Dashboard/Harim/PaymentExecutedListener.php
Normal file
30
app/Listeners/V3/Dashboard/Harim/PaymentExecutedListener.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners\V3\Dashboard\Harim;
|
||||||
|
|
||||||
|
use App\Events\V3\Dashboard\Harim\PaymentExecutedEvent;
|
||||||
|
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||||
|
use App\Services\PanjarehVahed\SendPaymentInfoService;
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
|
||||||
|
class PaymentExecutedListener implements ShouldQueue
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name of the queue the job should be sent to.
|
||||||
|
*
|
||||||
|
* @var string|null
|
||||||
|
*/
|
||||||
|
public ?string $queue = 'harim';
|
||||||
|
|
||||||
|
public function __construct(){}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function handle(PaymentExecutedEvent $event, SendPaymentInfoService $sendPaymentInfoService): void
|
||||||
|
{
|
||||||
|
$sendPaymentInfoService->makeInputParameters($event->harim->data);
|
||||||
|
$sendPaymentInfoService->run();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Listeners\V3\Dashboard\Harim;
|
namespace App\Listeners\V3\Dashboard\Harim;
|
||||||
|
|
||||||
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
|
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
|
||||||
|
use App\Services\PanjarehVahed\SendAccessRoadStatusService;
|
||||||
|
use Exception;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Http\Client\RequestException;
|
|
||||||
use Illuminate\Support\Facades\Http;
|
|
||||||
|
|
||||||
class RejectRequestListener implements ShouldQueue
|
class RejectRequestListener implements ShouldQueue
|
||||||
{
|
{
|
||||||
@@ -16,38 +16,14 @@ class RejectRequestListener implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public ?string $queue = 'harim';
|
public ?string $queue = 'harim';
|
||||||
|
|
||||||
protected string $url;
|
public function __construct(){}
|
||||||
protected string $password;
|
|
||||||
protected string $username;
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
$this->url = config('harim_web_services.Reject.url');
|
|
||||||
$this->username = config('harim_web_services.Reject.username');
|
|
||||||
$this->password = config('harim_web_services.Reject.password');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws RequestException
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(RejectRequestEvent $event): void
|
public function handle(RejectRequestEvent $event, SendAccessRoadStatusService $sendAccessRoadStatusService): void
|
||||||
{
|
{
|
||||||
$encodedData = openssl_decrypt($event->harim->data);
|
$sendAccessRoadStatusService->makeInputParameters($event->harim->data);
|
||||||
|
$sendAccessRoadStatusService->run();
|
||||||
$data = [
|
|
||||||
'data' => [
|
|
||||||
'actionId' => $encodedData['actionId'],
|
|
||||||
'ruleId' => $encodedData['ruleId'],
|
|
||||||
'activityId' => $encodedData['activityId'],
|
|
||||||
'requestId' => $encodedData['requestId'],
|
|
||||||
'taskId' => $encodedData['taskId'],
|
|
||||||
'code' => $encodedData['code'],
|
|
||||||
'resultStatus' => $encodedData['resultStatus'],
|
|
||||||
'Description' => $encodedData['Description'],
|
|
||||||
],
|
|
||||||
'token' => $encodedData['token']
|
|
||||||
];
|
|
||||||
|
|
||||||
Http::post($this->url, json_encode($data))->throw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ use App\Events\V3\Dashboard\Harim\ConfirmGuaranteeLetterNeedEvent;
|
|||||||
use App\Events\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedEvent;
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedEvent;
|
||||||
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
use App\Events\V3\Dashboard\Harim\ConfirmRoadAccessNeedEvent;
|
||||||
|
use App\Events\V3\Dashboard\Harim\PaymentExecutedEvent;
|
||||||
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
|
use App\Events\V3\Dashboard\Harim\RejectRequestEvent;
|
||||||
use App\Events\V3\Dashboard\Mission\SendDataToFMSEvent;
|
use App\Events\V3\Dashboard\Mission\SendDataToFMSEvent;
|
||||||
use App\Listeners\V3\Dashboard\Harim\ConfirmGuaranteeLetterNeedListener;
|
use App\Listeners\V3\Dashboard\Harim\ConfirmGuaranteeLetterNeedListener;
|
||||||
use App\Listeners\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedListener;
|
use App\Listeners\V3\Dashboard\Harim\ConfirmNoRoadAccessNeedListener;
|
||||||
use App\Listeners\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedListener;
|
use App\Listeners\V3\Dashboard\Harim\ConfirmRoadAccessEditNeedListener;
|
||||||
use App\Listeners\V3\Dashboard\Harim\ConfirmRoadAccessNeedListener;
|
use App\Listeners\V3\Dashboard\Harim\ConfirmRoadAccessNeedListener;
|
||||||
|
use App\Listeners\V3\Dashboard\Harim\PaymentExecutedListener;
|
||||||
use App\Listeners\V3\Dashboard\Harim\RejectRequestListener;
|
use App\Listeners\V3\Dashboard\Harim\RejectRequestListener;
|
||||||
use App\Listeners\V3\Dashboard\Mission\SendDataToFMSListener;
|
use App\Listeners\V3\Dashboard\Mission\SendDataToFMSListener;
|
||||||
use Illuminate\Auth\Events\Registered;
|
use Illuminate\Auth\Events\Registered;
|
||||||
@@ -55,7 +57,10 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
],
|
],
|
||||||
SendDataToFMSEvent::class => [
|
SendDataToFMSEvent::class => [
|
||||||
SendDataToFMSListener::class
|
SendDataToFMSListener::class
|
||||||
]
|
],
|
||||||
|
PaymentExecutedEvent::class => [
|
||||||
|
PaymentExecutedListener::class
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
74
app/Services/PanjarehVahed/SendAccessRoadStatusService.php
Normal file
74
app/Services/PanjarehVahed/SendAccessRoadStatusService.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\PanjarehVahed;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class SendAccessRoadStatusService
|
||||||
|
{
|
||||||
|
protected string $url;
|
||||||
|
protected string $channelName;
|
||||||
|
protected string $inputParameters;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = config('harim_web_services.Reject.url');
|
||||||
|
$this->channelName = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function run(): array
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return $this->sendRequest();
|
||||||
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
Log::channel($this->channelName)
|
||||||
|
->error(get_class($this),
|
||||||
|
[
|
||||||
|
'message' => $e->getMessage(),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sendRequest(): array
|
||||||
|
{
|
||||||
|
return Http::withHeaders(['Content-Type' => 'application/json'])
|
||||||
|
->withBody($this->inputParameters)
|
||||||
|
->throw()
|
||||||
|
->withoutVerifying()
|
||||||
|
->post($this->url)
|
||||||
|
->json();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function makeInputParameters($data): void
|
||||||
|
{
|
||||||
|
$arrayData = json_decode($data, true);
|
||||||
|
|
||||||
|
$inputParameters = [
|
||||||
|
'data' => [
|
||||||
|
'actionId' => $arrayData['actionId'],
|
||||||
|
'ruleId' => $arrayData['ruleId'],
|
||||||
|
'activityId' => $arrayData['activityId'],
|
||||||
|
'requestId' => $arrayData['requestId'],
|
||||||
|
'taskId' => $arrayData['taskId'],
|
||||||
|
'code' => $arrayData['code'],
|
||||||
|
'resultStatus' => $arrayData['resultStatus'],
|
||||||
|
'Description' => $arrayData['Description'],
|
||||||
|
],
|
||||||
|
'token' => $arrayData['token'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$key = config('harim_web_services.Harim_Info.key');
|
||||||
|
$iv = config('harim_web_services.Harim_Info.iv');
|
||||||
|
|
||||||
|
$this->inputParameters = openssl_encrypt(json_encode($inputParameters), 'aes-256-cbc', $key, false, $iv);
|
||||||
|
}
|
||||||
|
}
|
||||||
74
app/Services/PanjarehVahed/SendPaymentInfoService.php
Normal file
74
app/Services/PanjarehVahed/SendPaymentInfoService.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\PanjarehVahed;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class SendPaymentInfoService
|
||||||
|
{
|
||||||
|
protected string $url;
|
||||||
|
protected string $channelName;
|
||||||
|
protected string $inputParameters;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = config('harim_web_services.Reject.url');
|
||||||
|
$this->channelName = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function run(): array
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return $this->sendRequest();
|
||||||
|
}
|
||||||
|
catch (Exception $e) {
|
||||||
|
Log::channel($this->channelName)
|
||||||
|
->error(get_class($this),
|
||||||
|
[
|
||||||
|
'message' => $e->getMessage(),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sendRequest(): array
|
||||||
|
{
|
||||||
|
return Http::withHeaders(['Content-Type' => 'application/json'])
|
||||||
|
->withBody($this->inputParameters)
|
||||||
|
->throw()
|
||||||
|
->withoutVerifying()
|
||||||
|
->post($this->url)
|
||||||
|
->json();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function makeInputParameters($data): void
|
||||||
|
{
|
||||||
|
$arrayData = json_decode($data, true);
|
||||||
|
|
||||||
|
$inputParameters = [
|
||||||
|
'data' => [
|
||||||
|
'actionId' => $arrayData['actionId'],
|
||||||
|
'ruleId' => $arrayData['ruleId'],
|
||||||
|
'activityId' => $arrayData['activityId'],
|
||||||
|
'requestId' => $arrayData['requestId'],
|
||||||
|
'taskId' => $arrayData['taskId'],
|
||||||
|
'code' => $arrayData['code'],
|
||||||
|
'warrantStatus' => $arrayData['warrantStatus'],
|
||||||
|
'amountPaid' => $arrayData['amountPaid'],
|
||||||
|
],
|
||||||
|
'token' => $arrayData['token'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$key = config('harim_web_services.Harim_Info.key');
|
||||||
|
$iv = config('harim_web_services.Harim_Info.iv');
|
||||||
|
|
||||||
|
$this->inputParameters = openssl_encrypt(json_encode($inputParameters), 'aes-256-cbc', $key, false, $iv);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use App\Http\Controllers\V3\Dashboard\Harim\PanjareVahedController;
|
use App\Http\Controllers\V3\Dashboard\Harim\PanjareVahedController;
|
||||||
|
use App\Http\Controllers\V3\Dashboard\RoadMaintenanceStationController;
|
||||||
|
|
||||||
Route::prefix('harim')
|
Route::prefix('harim')
|
||||||
->name('harim.')
|
->name('harim.')
|
||||||
@@ -15,4 +16,11 @@ Route::prefix('harim')
|
|||||||
Route::post('/get_status_request','getRejectRequest')->name('getRejectRequest');
|
Route::post('/get_status_request','getRejectRequest')->name('getRejectRequest');
|
||||||
Route::post('/get_final_polygons','getFinalPolygons')->name('getFinalPolygons');
|
Route::post('/get_final_polygons','getFinalPolygons')->name('getFinalPolygons');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::prefix('road_maintenance_station')
|
||||||
|
->name('roadMaintenanceStation.')
|
||||||
|
->controller( RoadMaintenanceStationController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/list', 'giveListToFms')->name('giveListToFms');
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user