App\Http\Controllers\ClientPortalController::verifyPaymentMethod PHP Method

verifyPaymentMethod() public method

public verifyPaymentMethod ( )
    public function verifyPaymentMethod()
    {
        $publicId = Input::get('source_id');
        $amount1 = Input::get('verification1');
        $amount2 = Input::get('verification2');
        if (!($contact = $this->getContact())) {
            return $this->returnError();
        }
        $client = $contact->client;
        $account = $client->account;
        $paymentDriver = $account->paymentDriver(null, GATEWAY_TYPE_BANK_TRANSFER);
        $result = $paymentDriver->verifyBankAccount($client, $publicId, $amount1, $amount2);
        if (is_string($result)) {
            Session::flash('error', $result);
        } else {
            Session::flash('message', trans('texts.payment_method_verified'));
        }
        return redirect()->to($account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods/');
    }