feat: Implement payment proof upload for orders, add payment method selection API, and seed bank transfer payment options.
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BankTransferPaymentSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$methods = [
|
||||
[
|
||||
'name' => 'Số dư tài khoản',
|
||||
'type' => 0,
|
||||
'accountNo' => '',
|
||||
'bankName' => '',
|
||||
'bankCode' => '',
|
||||
'logo' => '',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Chuyển khoản ngân hàng',
|
||||
'type' => 1,
|
||||
'accountNo' => '',
|
||||
'bankName' => '',
|
||||
'bankCode' => '',
|
||||
'logo' => '',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Chuyển khoản VNPAY',
|
||||
'type' => 1,
|
||||
'accountNo' => '',
|
||||
'bankName' => 'VNPAY',
|
||||
'bankCode' => 'VNPAY',
|
||||
'logo' => '',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Chuyển khoản ACB',
|
||||
'type' => 1,
|
||||
'accountNo' => '',
|
||||
'bankName' => 'Ngân hàng ACB',
|
||||
'bankCode' => 'ACB',
|
||||
'logo' => '',
|
||||
'status' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'Chuyển khoản MB',
|
||||
'type' => 1,
|
||||
'accountNo' => '',
|
||||
'bankName' => 'Ngân hàng MB',
|
||||
'bankCode' => 'MB',
|
||||
'logo' => '',
|
||||
'status' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($methods as $method) {
|
||||
DB::table('payment')
|
||||
->where('name', $method['name'])
|
||||
->exists() ?: DB::table('payment')->insert(array_merge($method, [
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user