From 52109394bded6650e114181c3b25b38cfac51fab Mon Sep 17 00:00:00 2001 From: fsociety Date: Thu, 24 Oct 2024 16:58:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(association):=20adjust=20che?= =?UTF-8?q?ckout=20expiration=20and=20handle=20expired=20payment=20events?= =?UTF-8?q?=20in=20profile=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/pages/association/profile.blade.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/views/pages/association/profile.blade.php b/resources/views/pages/association/profile.blade.php index a87e79b..3c62bfc 100644 --- a/resources/views/pages/association/profile.blade.php +++ b/resources/views/pages/association/profile.blade.php @@ -91,7 +91,7 @@ $pay = function ($comment) { ], ], 'checkout' => [ - 'expirationMinutes' => 60 * 24 * 356, + 'expirationMinutes' => 60 * 24, 'redirectURL' => url()->route('association.profile'), 'redirectAutomatically' => true, 'defaultLanguage' => 'de', @@ -122,6 +122,10 @@ $listenForPayment = function () { ->get( 'https://pay.einundzwanzig.space/api/v1/stores/98PF86BoMd3C8P1nHHyFdoeznCwtcm5yehcAgoCYDQ2a/invoices/' . $paymentEvent->btc_pay_invoice, ); + if ($response->json()['status'] === 'Expired') { + $paymentEvent->btc_pay_invoice = null; + $paymentEvent->save(); + } if ($response->json()['status'] === 'Settled') { $paymentEvent->paid = true; $paymentEvent->save(); @@ -533,7 +537,8 @@ $loadEvents = function () { @if($payment->btc_pay_invoice) - @endif