online payments for card order

This commit is contained in:
2025-10-31 02:16:15 +05:00
parent 5d3ea6d787
commit 1873486d13
8 changed files with 104 additions and 34 deletions

View File

@@ -59,6 +59,16 @@ class CardOrderModule implements ModuleContract
name: 'Branch',
message: 'This module is used for branches.',
),
new ModulePackage(
type: ModulePackageType::MODULE,
name: 'OrderStatus',
message: 'Supports orders.',
),
new ModulePackage(
type: ModulePackageType::MODULE,
name: 'OnlinePayment',
message: 'Is online payable.',
),
];
}

View File

@@ -6,6 +6,7 @@ use App\Models\User;
use App\Modules\Branch\Interfaces\BelongsToBranch;
use App\Modules\Branch\Models\Branch;
use App\Modules\LoanOrder\Repositories\LoanOrderRepository;
use App\Modules\OnlinePayment\Contracts\HasOnlinePayments;
use App\Modules\OrderStatus\Interfaces\HasStatus;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

View File

@@ -19,7 +19,7 @@ class CardOrderRepository
/** @var \App\Modules\Branch\Models\Branch */
$branch = $record->branch;
return OnlinePaymentRepository::make()
return OnlinePaymentRepository::make(relatedModel: $record)
->paymentProvider(
HalkbankOnlinePaymentRepository::make()
->setUsername($branch->billingUsername())