mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve offsite payment checks
This commit is contained in:
parent
cef35a98e1
commit
078964d297
@ -715,6 +715,18 @@ class BasePaymentDriver
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check invoice still has balance
|
||||||
|
if ( ! $this->invoice()->balance) {
|
||||||
|
throw new Exception(trans('texts.payment_error_code', ['code' => 'NB']));
|
||||||
|
}
|
||||||
|
|
||||||
|
// check this isn't a duplicate transaction reference
|
||||||
|
if (Payment::whereAccountId($this->invitation->account_id)
|
||||||
|
->whereTransactionReference($ref)
|
||||||
|
->first()) {
|
||||||
|
throw new Exception(trans('texts.payment_error_code', ['code' => 'DT']));
|
||||||
|
}
|
||||||
|
|
||||||
return $this->createPayment($ref);
|
return $this->createPayment($ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2040,6 +2040,8 @@ $LANG = array(
|
|||||||
'enable_buy_now_buttons_help' => 'Enable support for buy now buttons',
|
'enable_buy_now_buttons_help' => 'Enable support for buy now buttons',
|
||||||
'changes_take_effect_immediately' => 'Note: changes take effect immediately',
|
'changes_take_effect_immediately' => 'Note: changes take effect immediately',
|
||||||
'wepay_account_description' => 'Payment gateway for Invoice Ninja',
|
'wepay_account_description' => 'Payment gateway for Invoice Ninja',
|
||||||
|
'payment_error_code' => 'There was an error processing your payment [:code]. Please try again later.',
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user