App\Ninja\PaymentDrivers\StripePaymentDriver::checkCustomerExists PHP Méthode

checkCustomerExists() protected méthode

protected checkCustomerExists ( $customer )
    protected function checkCustomerExists($customer)
    {
        $response = $this->gateway()->fetchCustomer(['customerReference' => $customer->token])->send();
        if (!$response->isSuccessful()) {
            return false;
        }
        $this->tokenResponse = $response->getData();
        // import Stripe tokens created before payment methods table was added
        if (!count($customer->payment_methods)) {
            if ($paymentMethod = $this->createPaymentMethod($customer)) {
                $customer->default_payment_method_id = $paymentMethod->id;
                $customer->save();
                $customer->load('payment_methods');
            }
        }
        return true;
    }