Payment methode now selectable

This commit is contained in:
2026-08-05 16:53:35 +02:00
parent 7919d04dc3
commit daff70b4fe
22 changed files with 705 additions and 81 deletions
@@ -10,6 +10,7 @@ class AvailablePaymentMethodResource extends JsonResource {
private AvailablePaymentMethod $availablePaymentMethod;
public function __construct(AvailablePaymentMethod $availablePaymentMethod) {
parent::__construct($availablePaymentMethod);
$this->availablePaymentMethod = $availablePaymentMethod;
}
@@ -29,6 +30,7 @@ class AvailablePaymentMethodResource extends JsonResource {
'active' => $this->availablePaymentMethod->active,
'configuration' => (object) $configuration,
'optionsSchema' => PaymentMethod::optionsFor($this->availablePaymentMethod->slug),
'participantOptionsSchema' => PaymentMethod::participantOptionsFor($this->availablePaymentMethod->slug),
];
}
}
+1 -1
View File
@@ -135,7 +135,7 @@ class EventResource extends JsonResource{
fn($eatingHabit) => new EatingHabitResource($eatingHabit))->toArray();
$returnArray['paymentMethods'] = $this->event->paymentMethods()->get()->map(
fn($paymentMethod) => new AvailablePaymentMethodResource($paymentMethod))->toArray();
fn($paymentMethod) => new AvailablePaymentMethodResource($paymentMethod)->toArray($request))->toArray();
$returnArray['participationTypes'] = [];