From 2c17d39001aafe2c85e3545a2746d33c98596b85 Mon Sep 17 00:00:00 2001 From: Glauber Silva Date: Thu, 18 Apr 2024 17:23:01 -0300 Subject: [PATCH] fix: broken donations on v2 forms --- .../Adapters/LegacyPaymentGatewayAdapter.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php b/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php index efa1b7f7c0..6af293b235 100644 --- a/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php +++ b/src/LegacyPaymentGateways/Adapters/LegacyPaymentGatewayAdapter.php @@ -49,6 +49,7 @@ public function getLegacyFormFieldMarkup( /** * First we create a payment, then move on to the gateway processing * + * @unreleased Add support to "phone" property * @since 3.2.0 Capture exceptions when get gateway data. * @since 3.0.0 Catch and handle errors from the gateway here * @since 2.30.0 Add success, cancel and failed URLs to gateway data. This will be used in both v2 and v3 forms so gateways can just refer to the gateway data. @@ -84,7 +85,8 @@ public function handleBeforeGateway(array $legacyDonationData, PaymentGateway $r $formData->donorInfo->email, $formData->donorInfo->firstName, $formData->donorInfo->lastName, - $formData->donorInfo->honorific + $formData->donorInfo->honorific, + '' ); $donation = $formData->toDonation($donor->id); @@ -324,6 +326,7 @@ private function setSession($donationId) } /** + * @unreleased Add support to "phone" property * @since 3.4.0 add $formId and do_action * @since 3.2.0 add honorific and use GetOrCreateDonor action * @since 2.21.0 @@ -336,7 +339,8 @@ private function getOrCreateDonor( string $donorEmail, string $firstName, string $lastName, - ?string $honorific + ?string $honorific, + ?string $donorPhone ): Donor { $getOrCreateDonorAction = new GetOrCreateDonor(); @@ -345,7 +349,8 @@ private function getOrCreateDonor( $donorEmail, $firstName, $lastName, - $honorific + $honorific, + $donorPhone ); if ($getOrCreateDonorAction->donorCreated) {