App\Ninja\PaymentDrivers\StripePaymentDriver::verifyBankAccount PHP Method

verifyBankAccount() public method

public verifyBankAccount ( $client, $publicId, $amount1, $amount2 )
    public function verifyBankAccount($client, $publicId, $amount1, $amount2)
    {
        $customer = $this->customer($client->id);
        $paymentMethod = PaymentMethod::clientId($client->id)->wherePublicId($publicId)->firstOrFail();
        // Omnipay doesn't support verifying payment methods
        // Also, it doesn't want to urlencode without putting numbers inside the brackets
        $result = $this->makeStripeCall('POST', 'customers/' . $customer->token . '/sources/' . $paymentMethod->source_reference . '/verify', 'amounts[]=' . intval($amount1) . '&amounts[]=' . intval($amount2));
        if (is_string($result)) {
            return $result;
        }
        $paymentMethod->status = PAYMENT_METHOD_STATUS_VERIFIED;
        $paymentMethod->save();
        if (!$customer->default_payment_method_id) {
            $customer->default_payment_method_id = $paymentMethod->id;
            $customer->save();
        }
        return true;
    }