diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 183578d89342..7919cbe23882 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -330,7 +330,7 @@ class BaseDriver extends AbstractPaymentDriver $payment->gateway_type_id = $data['gateway_type_id']; $client_contact = $this->getContact(); - $client_contact_id = $client_contact ? $client_contact->id : null; + $client_contact_id = $client_contact ? $client_contact->id : $this->client->contacts()->first()->id; $payment->amount = $data['amount']; $payment->type_id = $data['payment_type']; @@ -430,9 +430,9 @@ class BaseDriver extends AbstractPaymentDriver public function getContact() { if ($this->invitation) { - return ClientContact::find($this->invitation->client_contact_id); + return ClientContact::withTrashed()->find($this->invitation->client_contact_id); } elseif (auth()->guard('contact')->user()) { - return auth()->user(); + return auth()->guard('contact')->user(); } else { return false; } diff --git a/app/PaymentDrivers/Square/CreditCard.php b/app/PaymentDrivers/Square/CreditCard.php index 0a8f596ca65d..080356edc357 100644 --- a/app/PaymentDrivers/Square/CreditCard.php +++ b/app/PaymentDrivers/Square/CreditCard.php @@ -298,7 +298,7 @@ class CreditCard implements MethodInterface $body->setFamilyName(''); $body->setEmailAddress($this->square_driver->client->present()->email()); $body->setAddress($billing_address); - $body->setPhoneNumber($this->square_driver->client->phone); + // $body->setPhoneNumber($this->square_driver->client->phone); $body->setReferenceId($this->square_driver->client->number); $body->setNote('Created by Invoice Ninja.'); @@ -314,8 +314,8 @@ class CreditCard implements MethodInterface return $result->getCustomer()->getId(); } else { $errors = $api_response->getErrors(); - - return $this->processUnsuccessfulPayment($errors); + nlog($errors); + return $this->processUnsuccessfulPayment($api_response); } } }