File: D:/HostingSpaces/SBogers10/shop.komma.nl/database/factories/PaymentRelatedFactories.php
<?php
/*
|--------------------------------------------------------------------------
| Product Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories.
| Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
*/
use App\Orders\Models\Order;
use App\Payment\Clients\MultiSafepay\Enums\OrderStatus;
use App\Payment\Transaction;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
$prefix = '';
$factory->define(Transaction::class, function (Faker\Generator $faker) use ($prefix) {
// $faker->addProvider(ProductNamesFaker::class);
return [
'order_id' => Order::inRandomOrder()->first()->id,
'amount' => mt_rand(10, 9999),
'psp_payment_reference' => Str::random(24),
'psp' => 'KommaPSP - Factory',
'psp_id' => 'KommaPSP - Factory',
'ip' => $faker->ipv4,
'currency_iso_4217_code' => 'EUR',
'error_code' => '',
'account_reference' => '',
'account_holder_name' => $faker->name,
'acccount_brand' => 'fake',
'issuer_id' => 'somebank',
'payment_method' => 'KommaPal - Factory',
'status' => Arr::random(OrderStatus::getAsArray()),
'payment_link' => '',
];
});