From 45ca714b17169620a6ab68ceef784f1c52653951 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Thu, 12 Mar 2026 01:51:27 +0500 Subject: [PATCH] wip --- app/Helpers/helpers.php | 17 +++++++++++ app/Models/Warning.php | 11 +++++++ ...026_03_12_014848_create_warnings_table.php | 29 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 app/Models/Warning.php create mode 100644 database/migrations/2026_03_12_014848_create_warnings_table.php diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index e181f67..957b536 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -663,6 +663,14 @@ function syncVisaWithAzatAPI(VisaMasterPaymentOrderItem $orderItem): array ]; } + if (! isset($response['authRefNum'])) { + warn('payment missing authRefNum', $onlinePaymentResource->orderId); + return [ + 'error' => 'authRefNum missing', + 'type' => 'modal', + ]; + } + $systemRawResponse = syncWithBankSystem( online_payment_order_uuid: $onlinePaymentResource->orderId, bank_unique_code: $visaPaymentOrder->branch->unique_code, @@ -709,3 +717,12 @@ function syncVisaWithAzatAPI(VisaMasterPaymentOrderItem $orderItem): array 'type' => 'modal', ]; } + +function warn($message, $content) { + DB::table('warnings')->insert([ + $message => $message, + $content => $content, + 'created_at' => now(), + 'updated_at' => now(), + ]); +} diff --git a/app/Models/Warning.php b/app/Models/Warning.php new file mode 100644 index 0000000..3b6d09b --- /dev/null +++ b/app/Models/Warning.php @@ -0,0 +1,11 @@ +id(); + $table->string('message'); + $table->text('content'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('warnings'); + } +};