31 lines
867 B
PHP
31 lines
867 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\PaymentStatus;
|
|
use App\Models\UserPayment;
|
|
use App\Models\UserPaymentOption;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<UserPayment>
|
|
*/
|
|
class UserPaymentFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_payment_option_id' => UserPaymentOption::factory(),
|
|
'amount_cents' => fake()->numberBetween(990, 19900),
|
|
'currency' => 'EUR',
|
|
'status' => fake()->randomElement(PaymentStatus::cases())->value,
|
|
'stripe_charge_id' => fake()->optional()->regexify('ch_[A-Za-z0-9]{14}'),
|
|
'stripe_invoice_id' => fake()->optional()->regexify('in_[A-Za-z0-9]{14}'),
|
|
];
|
|
}
|
|
}
|