Giant Update
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\PaymentProvider;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PaymentProviderSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
foreach ([
|
||||
['paydisini', 'Paydisini', 'tenant', ['api_key']],
|
||||
['winpay', 'Winpay', 'tenant', ['merchant_id', 'api_key', 'private_key']],
|
||||
['doku', 'DOKU', 'both', ['client_id', 'secret_key']],
|
||||
['flip_business', 'Flip Business', 'tenant', ['token', 'validation_token']],
|
||||
['duitku', 'Duitku', 'both', ['merchant_code', 'api_key']],
|
||||
['midtrans', 'Midtrans', 'platform', ['merchant_id', 'client_key', 'server_key']],
|
||||
] as [$code, $name, $scope, $credentials]) {
|
||||
PaymentProvider::updateOrCreate(['code' => $code], [
|
||||
'name' => $name, 'scope' => $scope, 'enabled' => true,
|
||||
'capabilities' => ['payment' => true, 'inquiry' => true, 'webhook' => true, 'refund' => in_array($code, ['doku', 'midtrans', 'duitku'])],
|
||||
'credential_schema' => collect($credentials)->map(fn ($key) => ['key' => $key, 'label' => str($key)->replace('_', ' ')->title(), 'secret' => ! str_contains($key, 'merchant_id') && ! str_contains($key, 'client_id')])->values(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user