Intégration fonctionnalites V1

This commit is contained in:
bastien
2026-07-04 22:30:18 +02:00
parent 55a558b536
commit 10ee859602
54 changed files with 4802 additions and 1018 deletions
@@ -9,7 +9,7 @@ class PaymentTransactionResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
$data = [
'uuid' => $this->uuid,
'provider' => $this->provider,
'provider_payment_id' => $this->provider_payment_id,
@@ -19,5 +19,19 @@ class PaymentTransactionResource extends JsonResource
'return_url' => $this->return_url,
'created_at' => $this->created_at?->toIso8601String(),
];
if ($this->provider === 'stripe' && is_array($this->raw_payload)) {
$clientSecret = $this->raw_payload['client_secret'] ?? null;
if (is_string($clientSecret) && $clientSecret !== '') {
$data['stripe'] = [
'payment_intent_id' => $this->provider_payment_id,
'client_secret' => $clientSecret,
'publishable_key' => config('services.stripe.key'),
];
}
}
return $data;
}
}