mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:17:30 -04:00
Fixes for return types with square
This commit is contained in:
parent
bf2f7f5585
commit
f472036d0d
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user