From b0038d3e94c350adc3096be830369db1da1a7991 Mon Sep 17 00:00:00 2001 From: Nurmuhammet Allanov Date: Wed, 29 Oct 2025 18:42:45 +0500 Subject: [PATCH] add online payment module --- ...29_181237_create_online_payments_table.php | 52 +++++++++++++++ .../OnlinePayment/Models/OnlinePayment.php | 46 +++++++++++++ .../OnlinePayment/OnlinePaymentModule.php | 64 +++++++++++++++++++ .../Repositories/OnlinePaymentRepository.php | 5 ++ 4 files changed, 167 insertions(+) create mode 100644 app/Modules/OnlinePayment/Database/Migrations/2025_10_29_181237_create_online_payments_table.php create mode 100644 app/Modules/OnlinePayment/Models/OnlinePayment.php create mode 100644 app/Modules/OnlinePayment/OnlinePaymentModule.php create mode 100644 app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php diff --git a/app/Modules/OnlinePayment/Database/Migrations/2025_10_29_181237_create_online_payments_table.php b/app/Modules/OnlinePayment/Database/Migrations/2025_10_29_181237_create_online_payments_table.php new file mode 100644 index 0000000..2d59df1 --- /dev/null +++ b/app/Modules/OnlinePayment/Database/Migrations/2025_10_29_181237_create_online_payments_table.php @@ -0,0 +1,52 @@ +string('refunded_amount')->nullable(); + $table->string('booking_number')->nullable()->index(); + $table->string('amount')->nullable(); + $table->string('depositedAmount')->nullable(); + $table->string('orderNumber')->nullable()->index(); + $table->string('description')->nullable(); + + $table->string('orderId')->nullable()->index(); + $table->string('cardholderName')->nullable()->index(); + $table->string('pan')->nullable()->index(); + + $table->string('expiration')->nullable(); + $table->string('formUrl')->nullable(); + $table->string('successUrl')->nullable(); + $table->string('errorUrl')->nullable(); + + $table->string('paymentStatus')->nullable()->index(); + $table->string('callbackStatus')->nullable(); + $table->string('username')->nullable()->index(); + $table->string('approvalCode')->nullable(); + + $table->unsignedBigInteger('online_paymantable_id')->index()->nullable(); + $table->string('online_paymantable_type')->index()->nullable(); + + $table->string('api_client')->nullable()->index(); + $table->json('api_response')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('online_payments'); + } +}; diff --git a/app/Modules/OnlinePayment/Models/OnlinePayment.php b/app/Modules/OnlinePayment/Models/OnlinePayment.php new file mode 100644 index 0000000..b692a4e --- /dev/null +++ b/app/Modules/OnlinePayment/Models/OnlinePayment.php @@ -0,0 +1,46 @@ + + */ + protected function casts(): array + { + return [ + 'api_response' => 'array', + ]; + } +} diff --git a/app/Modules/OnlinePayment/OnlinePaymentModule.php b/app/Modules/OnlinePayment/OnlinePaymentModule.php new file mode 100644 index 0000000..990d4b5 --- /dev/null +++ b/app/Modules/OnlinePayment/OnlinePaymentModule.php @@ -0,0 +1,64 @@ +enabled; + } + + /** + * Disable module + */ + public function disable(): void + { + $this->enabled = false; + } + + /** + * Enable module + */ + public function enable(): void + { + $this->enabled = true; + } + + /** + * Check if module has a filament resource + */ + public function hasFilamentResource(): bool + { + return false; + } + + /** + * Get module composer requirements + */ + public function getComposerRequirements(): array + { + return []; + } + + /** + * Get module composer suggestions + */ + public function getComposerSuggestions(): array + { + return []; + } +} diff --git a/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php b/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php new file mode 100644 index 0000000..9419bc3 --- /dev/null +++ b/app/Modules/OnlinePayment/Repositories/OnlinePaymentRepository.php @@ -0,0 +1,5 @@ +