Catch mollie payments if redirect URL is null

This commit is contained in:
David Bomba 2022-12-09 09:33:19 +11:00
parent 62950e7549
commit b2ff2a1c18
3 changed files with 39 additions and 3 deletions

View File

@ -91,7 +91,11 @@ class CreditCard
if ($payment->status === 'open') {
$this->mollie->payment_hash->withData('payment_id', $payment->id);
return redirect()->away($payment->getCheckoutUrl());
if(!$payment->getCheckoutUrl())
return render('gateways.mollie.mollie_placeholder');
else
return redirect()->away($payment->getCheckoutUrl());
}
} catch (\Exception $e) {
return $this->processUnsuccessfulPayment($e);
@ -151,7 +155,13 @@ class CreditCard
if ($payment->status === 'open') {
$this->mollie->payment_hash->withData('payment_id', $payment->id);
return redirect()->away($payment->getCheckoutUrl());
nlog("Mollie");
nlog($payment);
if(!$payment->getCheckoutUrl())
return render('gateways.mollie.mollie_placeholder');
else
return redirect()->away($payment->getCheckoutUrl());
}
} catch (\Exception $e) {
$this->processUnsuccessfulPayment($e);

View File

@ -0,0 +1,26 @@
@extends('portal.ninja2020.layout.clean')
@section('meta_title', 'Mollie')
@section('body')
<div class="grid lg:grid-cols-3">
<div class="hidden lg:block col-span-1 bg-red-100 h-screen">
<img src="{{ asset('images/client-portal-new-image.jpg') }}"
class="w-full h-screen object-cover"
alt="Background image">
</div>
<div class="col-span-2 h-screen flex">
<div class="m-auto md:w-1/2 lg:w-1/4 flex flex-col items-center">
<span class="flex items-center text-2xl">
{{ ctrans('texts.payment_error_code',['code' => 500]) }}
</span>
<a class="button-link text-sm mt-2" href="{{ url(request()->getSchemeAndHttpHost() . '/client') }}">
{{ ctrans('texts.back_to', ['url' => parse_url(request()->getHttpHost())['host'] ?? request()->getHttpHost()]) }}
</a>
</div>
</div>
</div>
@endsection

View File

@ -3,7 +3,7 @@
<head>
<!-- Error: {{ session('error') }} -->
@if (isset($company) && $company->matomo_url && $company->matomo_id)
@if (isset($company) && $company->matomo_url && $company->matomo_id)
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */