diff --git a/backend/app/Models/Gateway.php b/backend/app/Models/Gateway.php new file mode 100644 index 00000000..d7b58f9c --- /dev/null +++ b/backend/app/Models/Gateway.php @@ -0,0 +1,15 @@ + */ + use HasFactory; + + protected $guarded = ['id']; +} diff --git a/backend/app/Models/GatewayCategory.php b/backend/app/Models/GatewayCategory.php new file mode 100644 index 00000000..a6e44afe --- /dev/null +++ b/backend/app/Models/GatewayCategory.php @@ -0,0 +1,12 @@ + */ + use HasFactory; +} diff --git a/backend/app/Models/Payment.php b/backend/app/Models/Payment.php new file mode 100644 index 00000000..f4d1f85a --- /dev/null +++ b/backend/app/Models/Payment.php @@ -0,0 +1,15 @@ + */ + use HasFactory; + + protected $guarded = ['id']; +} diff --git a/backend/app/Models/PaymentStatus.php b/backend/app/Models/PaymentStatus.php new file mode 100644 index 00000000..c222ee0e --- /dev/null +++ b/backend/app/Models/PaymentStatus.php @@ -0,0 +1,12 @@ + */ + use HasFactory; +} diff --git a/backend/app/User/Services/FIB/AuthorizationService.php b/backend/app/Services/FIB/AuthorizationService.php similarity index 97% rename from backend/app/User/Services/FIB/AuthorizationService.php rename to backend/app/Services/FIB/AuthorizationService.php index 9e67d55d..9867133f 100755 --- a/backend/app/User/Services/FIB/AuthorizationService.php +++ b/backend/app/Services/FIB/AuthorizationService.php @@ -1,6 +1,6 @@ + */ +class GatewayCategoryFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/backend/database/factories/GatewayFactory.php b/backend/database/factories/GatewayFactory.php new file mode 100644 index 00000000..f8029ab5 --- /dev/null +++ b/backend/database/factories/GatewayFactory.php @@ -0,0 +1,24 @@ + + */ +class GatewayFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/backend/database/factories/PaymentFactory.php b/backend/database/factories/PaymentFactory.php new file mode 100644 index 00000000..8bfd4911 --- /dev/null +++ b/backend/database/factories/PaymentFactory.php @@ -0,0 +1,24 @@ + + */ +class PaymentFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/backend/database/factories/PaymentStatusFactory.php b/backend/database/factories/PaymentStatusFactory.php new file mode 100644 index 00000000..390010db --- /dev/null +++ b/backend/database/factories/PaymentStatusFactory.php @@ -0,0 +1,24 @@ + + */ +class PaymentStatusFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/backend/database/migrations/2026_05_17_053830_create_payment_statuses_table.php b/backend/database/migrations/2026_05_17_053830_create_payment_statuses_table.php new file mode 100644 index 00000000..754a8790 --- /dev/null +++ b/backend/database/migrations/2026_05_17_053830_create_payment_statuses_table.php @@ -0,0 +1,28 @@ +id(); + $table->string('name'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('payment_statuses'); + } +}; diff --git a/backend/database/migrations/2026_05_17_053831_create_gateway_categories_table.php b/backend/database/migrations/2026_05_17_053831_create_gateway_categories_table.php new file mode 100644 index 00000000..16ee53ea --- /dev/null +++ b/backend/database/migrations/2026_05_17_053831_create_gateway_categories_table.php @@ -0,0 +1,28 @@ +id(); + $table->string('name'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('gateway_categories'); + } +}; diff --git a/backend/database/migrations/2026_05_17_053832_create_gateways_table.php b/backend/database/migrations/2026_05_17_053832_create_gateways_table.php new file mode 100644 index 00000000..faab5d50 --- /dev/null +++ b/backend/database/migrations/2026_05_17_053832_create_gateways_table.php @@ -0,0 +1,38 @@ +id(); + $table->foreignId('user_id')->constrained('users'); + $table->string('username'); + $table->string('name'); + $table->string('domain'); + $table->string('tax_id'); + $table->string('bank_name'); + $table->string('account_holder'); + $table->string('logo')->nullable(); + $table->string('iban'); + $table->foreignId('category_id')->constrained('gateway_categories'); + $table->string('category_name'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('gateways'); + } +}; diff --git a/backend/database/migrations/2026_05_17_053833_create_payments_table.php b/backend/database/migrations/2026_05_17_053833_create_payments_table.php new file mode 100644 index 00000000..0bf5cc2e --- /dev/null +++ b/backend/database/migrations/2026_05_17_053833_create_payments_table.php @@ -0,0 +1,38 @@ +id(); + $table->foreignId('user_id')->constrained('users'); + $table->string('username'); + $table->uuid('track_id'); + $table->string('amount'); + $table->string('currency'); + $table->string('callback_url'); + $table->dateTime('expires_at'); + $table->foreignId('status_id')->constrained('payment_statuses'); + $table->string('status_name'); + $table->ipAddress('ip'); + $table->foreignId('gateway_id')->constrained('gateways'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('payments'); + } +}; diff --git a/backend/database/seeders/GatewayCategorySeeder.php b/backend/database/seeders/GatewayCategorySeeder.php new file mode 100644 index 00000000..6e41f3b8 --- /dev/null +++ b/backend/database/seeders/GatewayCategorySeeder.php @@ -0,0 +1,17 @@ +