HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/farmfun/reserveren.farmfun.be/app/Komma/Shop/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\Komma\Shop\Orders\Models\Order;
use App\Komma\Shop\Payment\Clients\MultiSafepay\Enums\OrderStatus;
use App\Komma\Shop\Payment\Transaction;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;

$prefix = '';

$factory->define(Transaction::class, function (Faker\Generator $faker) use ($prefix) {
    $faker->addProvider(\App\Komma\Shop\Development\Fakers\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' => '',
    ];
});