From 7c70d2ca591f3de132736f055ff20556aa28aa28 Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Tue, 3 Dec 2024 12:48:48 +0100 Subject: [PATCH] fix php7.4 compatibility --- src/Http/Payload/CreateMandatePayload.php | 2 +- src/Http/Payload/CreatePaymentLinkPayload.php | 2 +- src/Http/Payload/CreateSubscriptionPayload.php | 2 +- src/Http/Payload/UpdateSubscriptionPayload.php | 2 +- src/Http/Query/GetAllMethodsQuery.php | 2 +- src/Http/Query/GetEnabledPaymentMethodsQuery.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Http/Payload/CreateMandatePayload.php b/src/Http/Payload/CreateMandatePayload.php index fda0ccbf..db799c11 100644 --- a/src/Http/Payload/CreateMandatePayload.php +++ b/src/Http/Payload/CreateMandatePayload.php @@ -50,7 +50,7 @@ public function data(): array 'consumerAccount' => $this->consumerAccount, 'consumerBic' => $this->consumerBic, 'consumerEmail' => $this->consumerEmail, - 'signatureDate' => $this->signatureDate?->format('Y-m-d'), + 'signatureDate' => $this->signatureDate ? $this->signatureDate->format('Y-m-d') : null, 'mandateReference' => $this->mandateReference, 'paypalBillingAgreementId' => $this->paypalBillingAgreementId, ]; diff --git a/src/Http/Payload/CreatePaymentLinkPayload.php b/src/Http/Payload/CreatePaymentLinkPayload.php index c131c341..a66c62cf 100644 --- a/src/Http/Payload/CreatePaymentLinkPayload.php +++ b/src/Http/Payload/CreatePaymentLinkPayload.php @@ -47,7 +47,7 @@ public function data(): array 'webhookUrl' => $this->webhookUrl, 'profileId' => $this->profileId, 'reusable' => $this->reusable, - 'expiresAt' => $this->expiresAt?->format('Y-m-d'), + 'expiresAt' => $this->expiresAt ? $this->expiresAt->format('Y-m-d') : null, ]; } } diff --git a/src/Http/Payload/CreateSubscriptionPayload.php b/src/Http/Payload/CreateSubscriptionPayload.php index 648ba89a..49769e41 100644 --- a/src/Http/Payload/CreateSubscriptionPayload.php +++ b/src/Http/Payload/CreateSubscriptionPayload.php @@ -66,7 +66,7 @@ public function data(): array 'description' => $this->description, 'status' => $this->status, 'times' => $this->times, - 'startDate' => $this->startDate?->format('Y-m-d'), + 'startDate' => $this->startDate ? $this->startDate->format('Y-m-d') : null, 'method' => $this->method, 'applicationFee' => $this->applicationFee, 'metadata' => $this->metadata, diff --git a/src/Http/Payload/UpdateSubscriptionPayload.php b/src/Http/Payload/UpdateSubscriptionPayload.php index 76cb09ad..669f6cec 100644 --- a/src/Http/Payload/UpdateSubscriptionPayload.php +++ b/src/Http/Payload/UpdateSubscriptionPayload.php @@ -48,7 +48,7 @@ public function data(): array 'amount' => $this->amount, 'description' => $this->description, 'interval' => $this->interval, - 'startDate' => $this->startDate?->format('Y-m-d'), + 'startDate' => $this->startDate ? $this->startDate->format('Y-m-d') : null, 'times' => $this->times, 'metadata' => $this->metadata, 'webhookUrl' => $this->webhookUrl, diff --git a/src/Http/Query/GetAllMethodsQuery.php b/src/Http/Query/GetAllMethodsQuery.php index 85040dd5..00ef7495 100644 --- a/src/Http/Query/GetAllMethodsQuery.php +++ b/src/Http/Query/GetAllMethodsQuery.php @@ -35,7 +35,7 @@ public function toArray(): array $this->includePricing ? MethodQuery::INCLUDE_PRICING : null, ]), 'locale' => $this->locale, - 'amount' => $this->amount?->data(), + 'amount' => $this->amount ? $this->amount->data() : null, ]; } } diff --git a/src/Http/Query/GetEnabledPaymentMethodsQuery.php b/src/Http/Query/GetEnabledPaymentMethodsQuery.php index 90cc6f6d..b0f11d96 100644 --- a/src/Http/Query/GetEnabledPaymentMethodsQuery.php +++ b/src/Http/Query/GetEnabledPaymentMethodsQuery.php @@ -26,7 +26,7 @@ public function toArray(): array return [ 'sequenceType' => $this->sequenceType, 'locale' => $this->locale, - 'amount' => $this->amount?->data(), + 'amount' => $this->amount ? $this->amount->data() : null, 'resource' => $this->resource, 'billingCountry' => $this->billingCountry, 'includeWallets' => Arr::join($this->includeWallets ?? []),