mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 02:47:34 -05: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'];
 | 
					        $payment->gateway_type_id = $data['gateway_type_id'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $client_contact = $this->getContact();
 | 
					        $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->amount = $data['amount'];
 | 
				
			||||||
        $payment->type_id = $data['payment_type'];
 | 
					        $payment->type_id = $data['payment_type'];
 | 
				
			||||||
@ -430,9 +430,9 @@ class BaseDriver extends AbstractPaymentDriver
 | 
				
			|||||||
    public function getContact()
 | 
					    public function getContact()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if ($this->invitation) {
 | 
					        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()) {
 | 
					        } elseif (auth()->guard('contact')->user()) {
 | 
				
			||||||
            return auth()->user();
 | 
					            return auth()->guard('contact')->user();
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -298,7 +298,7 @@ class CreditCard implements MethodInterface
 | 
				
			|||||||
        $body->setFamilyName('');
 | 
					        $body->setFamilyName('');
 | 
				
			||||||
        $body->setEmailAddress($this->square_driver->client->present()->email());
 | 
					        $body->setEmailAddress($this->square_driver->client->present()->email());
 | 
				
			||||||
        $body->setAddress($billing_address);
 | 
					        $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->setReferenceId($this->square_driver->client->number);
 | 
				
			||||||
        $body->setNote('Created by Invoice Ninja.');
 | 
					        $body->setNote('Created by Invoice Ninja.');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -314,8 +314,8 @@ class CreditCard implements MethodInterface
 | 
				
			|||||||
            return $result->getCustomer()->getId();
 | 
					            return $result->getCustomer()->getId();
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $errors = $api_response->getErrors();
 | 
					            $errors = $api_response->getErrors();
 | 
				
			||||||
 | 
					            nlog($errors);
 | 
				
			||||||
            return $this->processUnsuccessfulPayment($errors);
 | 
					            return $this->processUnsuccessfulPayment($api_response);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user