Payment methode now selectable
This commit is contained in:
@@ -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),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'] = [];
|
||||
|
||||
Reference in New Issue
Block a user