From 8ba5e12778fb4a2943ff9d77aa4c84b0e503c5c2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Sep 2022 13:01:13 +1000 Subject: [PATCH] Fixes for braintree --- app/PaymentDrivers/BraintreePaymentDriver.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/PaymentDrivers/BraintreePaymentDriver.php b/app/PaymentDrivers/BraintreePaymentDriver.php index d39c1cd740..412c56dd42 100644 --- a/app/PaymentDrivers/BraintreePaymentDriver.php +++ b/app/PaymentDrivers/BraintreePaymentDriver.php @@ -110,17 +110,17 @@ class BraintreePaymentDriver extends BaseDriver } $result = $this->gateway->customer()->create([ - 'firstName' => $this->client->present()->name, - 'email' => $this->client->present()->email, - 'phone' => $this->client->present()->phone, + 'firstName' => $this->client->present()->name(), + 'email' => $this->client->present()->email(), + 'phone' => $this->client->present()->phone(), ]); if ($result->success) { $address = $this->gateway->address()->create([ 'customerId' => $result->customer->id, - 'firstName' => $this->client->present()->name, - 'streetAddress' => $this->client->address1, - 'postalCode' => $this->client->postal_code, + 'firstName' => $this->client->present()->name(), + 'streetAddress' => $this->client->address1 ?: '', + 'postalCode' => $this->client->postal_code ?: '', 'countryCodeAlpha2' => $this->client->country ? $this->client->country->iso_3166_2 : '', ]);