mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Checkout.com import customers
This commit is contained in:
parent
37e2e772f9
commit
fc61065e69
@ -557,6 +557,14 @@ class CheckoutComPaymentDriver extends BaseDriver
|
||||
->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* ImportCustomers
|
||||
*
|
||||
* Only their methods because checkout.com
|
||||
* does not have a list route for customers
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function importCustomers()
|
||||
{
|
||||
$this->init();
|
||||
@ -567,25 +575,17 @@ class CheckoutComPaymentDriver extends BaseDriver
|
||||
->cursor()
|
||||
->each(function ($client){
|
||||
|
||||
nlog("1");
|
||||
|
||||
if(!str_contains($client->present()->email(), "@"))
|
||||
return;
|
||||
|
||||
|
||||
nlog("2");
|
||||
nlog($client->present()->email());
|
||||
|
||||
try{
|
||||
$customer = $this->gateway->getCustomersClient()->get($client->present()->email());
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
nlog("returning due to exception");
|
||||
nlog("Checkout: Customer not found");
|
||||
return;
|
||||
}
|
||||
|
||||
nlog("3");
|
||||
|
||||
$this->client = $client;
|
||||
|
||||
nlog($customer['instruments']);
|
||||
@ -599,9 +599,6 @@ nlog("3");
|
||||
)
|
||||
continue;
|
||||
|
||||
|
||||
nlog("4");
|
||||
|
||||
$payment_meta = new \stdClass();
|
||||
$payment_meta->exp_month = (string) $card['expiry_month'];
|
||||
$payment_meta->exp_year = (string) $card['expiry_year'];
|
||||
@ -617,7 +614,6 @@ nlog("4");
|
||||
|
||||
$this->storeGatewayToken($data, ['gateway_customer_reference' => $customer['id']]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user