mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Require authorization for ACH
This commit is contained in:
parent
37f4430e62
commit
70b9c9bba7
@ -447,6 +447,11 @@ class PaymentController extends BaseController
|
||||
|
||||
// check if we're creating/using a billing token
|
||||
if ($accountGateway->gateway_id == GATEWAY_STRIPE) {
|
||||
if ($paymentType == PAYMENT_TYPE_STRIPE_ACH && !Input::get('authorize_ach')) {
|
||||
Session::flash('error', trans('texts.ach_authorization_required'));
|
||||
return Redirect::to('payment/'.$invitationKey)->withInput(Request::except('cvv'));
|
||||
}
|
||||
|
||||
if ($useToken) {
|
||||
$details['customerReference'] = $client->getGatewayToken();
|
||||
unset($details['token']);
|
||||
|
@ -802,11 +802,16 @@ class PublicClientController extends BaseController
|
||||
$details = array('plaidPublicToken' => Input::get('plaidPublicToken'), 'plaidAccountId' => Input::get('plaidAccountId'));
|
||||
}
|
||||
|
||||
if ($paymentType == PAYMENT_TYPE_STRIPE_ACH && !Input::get('authorize_ach')) {
|
||||
Session::flash('error', trans('texts.ach_authorization_required'));
|
||||
return Redirect::to('client/paymentmethods/add/' . $typeLink)->withInput(Request::except('cvv'));
|
||||
}
|
||||
|
||||
if (!empty($details)) {
|
||||
$gateway = $this->paymentService->createGateway($accountGateway);
|
||||
$sourceId = $this->paymentService->createToken($gateway, $details, $accountGateway, $client, $invitation->contact_id);
|
||||
} else {
|
||||
return Redirect::to('payment/'.$invitation->invitation_key)->withInput(Request::except('cvv'));
|
||||
return Redirect::to('client/paymentmethods/add/' . $typeLink)->withInput(Request::except('cvv'));
|
||||
}
|
||||
|
||||
if(empty($sourceId)) {
|
||||
|
@ -1265,6 +1265,8 @@ $LANG = array(
|
||||
'plaid_linked_status' => 'Your bank account at :bank',
|
||||
'add_payment_method' => 'Add Payment Method',
|
||||
'account_holder_type' => 'Account Holder Type',
|
||||
'ach_authorization' => 'I authorize :company to electronically debit my account and, if necessary, electronically credit my account to correct erroneous debits.',
|
||||
'ach_authorization_required' => 'You must consent to ACH transactions.'
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
@ -245,7 +245,8 @@
|
||||
'account_number' => 'required',
|
||||
'routing_number' => 'required',
|
||||
'account_holder_name' => 'required',
|
||||
'account_holder_type' => 'required'
|
||||
'account_holder_type' => 'required',
|
||||
'authorize_ach' => 'required',
|
||||
)) !!}
|
||||
@else
|
||||
{!! Former::vertical_open($url)
|
||||
@ -457,9 +458,12 @@
|
||||
{!! Former::text('')
|
||||
->id('confirm_account_number')
|
||||
->label(trans('texts.confirm_account_number')) !!}
|
||||
{!! Former::checkbox('authorize_ach')
|
||||
->text(trans('texts.ach_authorization', ['company'=>$account->getDisplayName()]))
|
||||
->label(' ') !!}
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<div class="col-md-8 col-md-offset-4">
|
||||
{!! Button::success(strtoupper(trans('texts.add_account')))
|
||||
->submit()
|
||||
->withAttributes(['id'=>'add_account_button'])
|
||||
@ -470,7 +474,7 @@
|
||||
->withAttributes(['style'=>'display:none', 'id'=>'pay_now_button'])
|
||||
->large() !!}
|
||||
@endif
|
||||
</center>
|
||||
</div>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
Loading…
x
Reference in New Issue
Block a user