mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Merge pull request #1072 from joshuadwire/2016-09-payments-changes
Fix bugs when paying with stored card info
This commit is contained in:
commit
481c1b52a6
@ -253,8 +253,22 @@ class BasePaymentDriver
|
||||
->wherePublicId($this->sourceId)
|
||||
->firstOrFail();
|
||||
}
|
||||
} elseif ($this->shouldCreateToken()) {
|
||||
$paymentMethod = $this->createToken();
|
||||
|
||||
if ( ! $this->meetsGatewayTypeLimits($paymentMethod->payment_type->gateway_type_id)) {
|
||||
// The customer must have hacked the URL
|
||||
Session::flash('error', trans('texts.limits_not_met'));
|
||||
return redirect()->to('view/' . $this->invitation->invitation_key);
|
||||
}
|
||||
} else {
|
||||
if ($this->shouldCreateToken()) {
|
||||
$paymentMethod = $this->createToken();
|
||||
}
|
||||
|
||||
if ( ! $this->meetsGatewayTypeLimits($this->gatewayType)) {
|
||||
// The customer must have hacked the URL
|
||||
Session::flash('error', trans('texts.limits_not_met'));
|
||||
return redirect()->to('view/' . $this->invitation->invitation_key);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->isTwoStep()) {
|
||||
@ -334,7 +348,7 @@ class BasePaymentDriver
|
||||
protected function paymentDetails($paymentMethod = false)
|
||||
{
|
||||
$invoice = $this->invoice();
|
||||
$gatewayTypeAlias = GatewayType::getAliasFromId($this->gatewayType);
|
||||
$gatewayTypeAlias = $this->gatewayType == GATEWAY_TYPE_TOKEN ? $this->gatewayType : GatewayType::getAliasFromId($this->gatewayType);
|
||||
$completeUrl = url('complete/' . $this->invitation->invitation_key . '/' . $gatewayTypeAlias);
|
||||
|
||||
$data = [
|
||||
|
9549
public/css/built.public.css
vendored
9549
public/css/built.public.css
vendored
File diff suppressed because one or more lines are too long
271
public/css/daterangepicker.css
vendored
271
public/css/daterangepicker.css
vendored
File diff suppressed because one or more lines are too long
10530
public/js/Chart.min.js
vendored
10530
public/js/Chart.min.js
vendored
File diff suppressed because one or more lines are too long
9559
public/js/d3.min.js
vendored
9559
public/js/d3.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1621
public/js/daterangepicker.min.js
vendored
1621
public/js/daterangepicker.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
74412
public/pdf.built.js
74412
public/pdf.built.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user