Intégration fonctionnalites V1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class WalletTransactionResource extends JsonResource
|
||||
'balance_after' => (float) $this->balance_after,
|
||||
'source_type' => $this->source_type,
|
||||
'source_id' => $this->source_id,
|
||||
'metadata' => $this->metadata,
|
||||
'metadata' => $this->metadata ?? [],
|
||||
'created_at' => $this->created_at?->toIso8601String(),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user