Skip to content

Commit 96438db

Browse files
committed
chore: add application_type check
1 parent 2f08e3a commit 96438db

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,11 @@ L5_SWAGGER_CONST_TOKEN_URL=${IDP_TOKEN_ENDPOINT}
257257

258258
MEMCACHED_SERVER_HOST=127.0.0.1
259259
MEMCACHED_SERVER_PORT=11211
260+
261+
# PAYMENT SERVICE
262+
263+
PAYMENTS_SERVICE_BASE_URL=
264+
# CLIENT SHOULD BE CONFIGURED with SECRET POST at IDP
265+
PAYMENTS_SERVICE_OAUTH2_CLIENT_ID=
266+
PAYMENTS_SERVICE_OAUTH2_CLIENT_SECRET=
267+
PAYMENTS_SERVICE_OAUTH2_SCOPES=payment-profile/read

app/Jobs/Payments/CreatePaymentProfileMQJob.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Illuminate\Queue\InteractsWithQueue;
2121
use Illuminate\Queue\SerializesModels;
2222
use Illuminate\Support\Facades\Log;
23+
use models\summit\IPaymentConstants;
2324
use models\summit\ISummitRepository;
2425
use models\summit\Summit;
2526

@@ -60,6 +61,11 @@ public function handle(PaymentsMQJob $job): void{
6061
$data = $payload['data'];
6162
$id = intval($data['id']);
6263
$summit_id = intval($data['summit_id']);
64+
$application_type = $data['application_type'];
65+
if(!in_array($application_type, IPaymentConstants::ValidApplicationTypes)){
66+
Log::warning("CreatePaymentProfileMQJob::handle Application Type $application_type is not valid.");
67+
return;
68+
}
6369
$response = $this->payments_api->getPaymentProfile($summit_id, $id);
6470
Log::debug("CreatePaymentProfileMQJob::handle", ['response' => $response]);
6571
$summit = $this->summit_repository->getById($summit_id);

app/Jobs/Payments/DeletePaymentProfileMQJob.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Illuminate\Queue\InteractsWithQueue;
2121
use Illuminate\Queue\SerializesModels;
2222
use Illuminate\Support\Facades\Log;
23+
use models\summit\IPaymentConstants;
2324
use models\summit\ISummitRepository;
2425
use models\summit\PaymentGatewayProfile;
2526
use models\summit\Summit;
@@ -57,6 +58,11 @@ public function handle(PaymentsMQJob $job): void{
5758

5859
$id = intval($data['id']);
5960
$summit_id = intval($data['summit_id']);
61+
$application_type = $data['application_type'];
62+
if(!in_array($application_type, IPaymentConstants::ValidApplicationTypes)){
63+
Log::warning("DeletePaymentProfileMQJob::handle Application Type $application_type is not valid.");
64+
return;
65+
}
6066

6167
$summit = $this->summit_repository->getById($summit_id);
6268
$local_payment_profile = $this->payment_gateway_profile_repository->getByExternalId($id);

app/Jobs/Payments/UpdatePaymentProfileMQJob.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Illuminate\Queue\InteractsWithQueue;
2222
use Illuminate\Queue\SerializesModels;
2323
use Illuminate\Support\Facades\Log;
24+
use models\summit\IPaymentConstants;
2425
use models\summit\ISummitRepository;
2526
use models\summit\PaymentGatewayProfile;
2627
use models\summit\Summit;
@@ -67,6 +68,12 @@ public function handle(PaymentsMQJob $job): void{
6768
$data = $payload['data'];
6869
$id = intval($data['id']);
6970
$summit_id = intval($data['summit_id']);
71+
$application_type = $data['application_type'];
72+
73+
if(!in_array($application_type, IPaymentConstants::ValidApplicationTypes)){
74+
Log::warning("UpdatePaymentProfileMQJob::handle Application Type $application_type is not valid.");
75+
return;
76+
}
7077
$response = $this->payments_api->getPaymentProfile($summit_id, $id);
7178
Log::debug("UpdatePaymentProfileMQJob::handle", ['response' => $response]);
7279
$summit = $this->summit_repository->getById($summit_id);

0 commit comments

Comments
 (0)