mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for stripe catching aborted payments
This commit is contained in:
parent
a1dee0206f
commit
7fb139cd9b
@ -431,6 +431,10 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
|
|
||||||
public function sendFailureMail($error)
|
public function sendFailureMail($error)
|
||||||
{
|
{
|
||||||
|
if(is_object($error)){
|
||||||
|
$error = 'Payment Aborted';
|
||||||
|
}
|
||||||
|
|
||||||
if (! is_null($this->payment_hash)) {
|
if (! is_null($this->payment_hash)) {
|
||||||
$this->unWindGatewayFees($this->payment_hash);
|
$this->unWindGatewayFees($this->payment_hash);
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,16 @@ class CreditCard
|
|||||||
$this->stripe->client->company,
|
$this->stripe->client->company,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//if the user has come from a subscription double check here if we need to redirect
|
||||||
|
|
||||||
|
if($payment->invoices()->whereHas('subscription')->exists()){
|
||||||
|
$subscription = $payment->invoices()->first()->subscription;
|
||||||
|
|
||||||
|
if($subscription && array_key_exists('return_url', $subscription->webhook_configuration) && strlen($subscription->webhook_configuration['return_url']) >=1)
|
||||||
|
return redirect($subscription->webhook_configuration['return_url']);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->route('client.payments.show', ['payment' => $this->stripe->encodePrimaryKey($payment->id)]);
|
return redirect()->route('client.payments.show', ['payment' => $this->stripe->encodePrimaryKey($payment->id)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user