*/ class PaymentFactory extends Factory { protected $model = Payment::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $method = fake()->randomElement(['paypal', 'mobile_money', 'national_office']); $currency = $method === 'paypal' ? 'EUR' : 'XOF'; return [ 'registration_id' => null, 'contribution_id' => null, 'batch_id' => null, 'method' => $method, 'currency' => $currency, 'amount' => $currency === 'EUR' ? fake()->numberBetween(15, 1500) : fake()->numberBetween(10000, 1000000), 'status' => PaymentStatus::PENDING, 'provider_ref' => null, 'confirmed_by_user_id' => null, 'notes' => null, ]; } }