mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for when user cancels Dwolla payment
This commit is contained in:
parent
9afd99b245
commit
e678d2be62
@ -200,7 +200,7 @@ class AccountGatewayController extends BaseController
|
|||||||
$fields = $gateway->getFields();
|
$fields = $gateway->getFields();
|
||||||
$optional = array_merge(Gateway::$hiddenFields, Gateway::$optionalFields);
|
$optional = array_merge(Gateway::$hiddenFields, Gateway::$optionalFields);
|
||||||
|
|
||||||
if (Utils::isNinja() && $gatewayId == GATEWAY_DWOLLA) {
|
if ($gatewayId == GATEWAY_DWOLLA) {
|
||||||
$optional = array_merge($optional, ['key', 'secret']);
|
$optional = array_merge($optional, ['key', 'secret']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -685,6 +685,14 @@ class PaymentController extends BaseController
|
|||||||
$accountGateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'));
|
$accountGateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'));
|
||||||
$gateway = self::createGateway($accountGateway);
|
$gateway = self::createGateway($accountGateway);
|
||||||
|
|
||||||
|
// Check for Dwolla payment error
|
||||||
|
if ($accountGateway->isGateway(GATEWAY_DWOLLA) && Input::get('error')) {
|
||||||
|
$errorMessage = trans('texts.payment_error')."\n\n".Input::get('error_description');
|
||||||
|
Session::flash('error', $errorMessage);
|
||||||
|
Utils::logError($errorMessage);
|
||||||
|
return Redirect::to('view/'.$invitation->invitation_key);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (method_exists($gateway, 'completePurchase')) {
|
if (method_exists($gateway, 'completePurchase')) {
|
||||||
$details = self::getPaymentDetails($invitation);
|
$details = self::getPaymentDetails($invitation);
|
||||||
|
@ -34,5 +34,9 @@ class AccountGateway extends EntityModel
|
|||||||
public function isPaymentType($type) {
|
public function isPaymentType($type) {
|
||||||
return $this->getPaymentType() == $type;
|
return $this->getPaymentType() == $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isGateway($gatewayId) {
|
||||||
|
return $this->gateway_id == $gatewayId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user