Merge branch 'feature/bugFixes' into 'develop'

remove nikarayan service provider

See merge request witelgroup/rms_v2!11
This commit is contained in:
2024-04-20 07:37:54 +00:00
4 changed files with 7 additions and 42 deletions

View File

@@ -1,30 +0,0 @@
<?php
namespace App\Providers;
use App\Services\NikarayanService;
use Illuminate\Support\ServiceProvider;
use SoapClient;
class NikarayanServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//
}
/**
* Bootstrap services.
*/
public function boot(): void
{
$this->app->bind(NikarayanService::class, function () {
$url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
$soapClient = new SoapClient($url);
return new NikarayanService($soapClient);
});
}
}

View File

@@ -9,17 +9,12 @@ use SoapClient;
class NikarayanService class NikarayanService
{ {
protected SoapClient $soapClient;
public function __construct(SoapClient $soapClient)
{
$this->soapClient = $soapClient;
}
public function updateRoadObservedInfoByNikarayan(Request $request, RoadObserved $roadObserved, $files) public function updateRoadObservedInfoByNikarayan(Request $request, RoadObserved $roadObserved, $files)
{ {
if (App::isProduction()) if (App::isProduction())
{ {
$url = "https://riws.rmto.ir/WebServices/NRPTrafficStatus.asmx?wsdl";
$array = array('strUserName' => 'vaytelrop', $array = array('strUserName' => 'vaytelrop',
'strPassword' => 'VaYtelROP*2024', 'strPassword' => 'VaYtelROP*2024',
'strAutoID' => $roadObserved->fk_RegisteredEventMessage, 'strAutoID' => $roadObserved->fk_RegisteredEventMessage,
@@ -29,7 +24,10 @@ class NikarayanService
'strNextImageLink' => "https://rms.rmto.ir/".$files, 'strNextImageLink' => "https://rms.rmto.ir/".$files,
'strRMSDateAndTime' => $roadObserved->updated_at 'strRMSDateAndTime' => $roadObserved->updated_at
); );
return $this->soapClient->UpdateInfo_RoadObservedProblems($array);
$soapClient = new SoapClient($url);
return $soapClient->UpdateInfo_RoadObservedProblems($array);
} }
return 0; return 0;

View File

@@ -67,6 +67,6 @@ class PaymentService
abort(500); abort(500);
} }
} }
return 0; return json_encode(['isPayed' => 1]);
} }
} }

View File

@@ -179,10 +179,7 @@ return [
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,
App\Providers\TelescopeServiceProvider::class, App\Providers\TelescopeServiceProvider::class,
Barryvdh\Debugbar\ServiceProvider::class, Barryvdh\Debugbar\ServiceProvider::class,
App\Providers\NikarayanServiceProvider::class,
], ],
/* /*