From 1fb59bd1d6cf70726b8e1aa9398f040d49310f39 Mon Sep 17 00:00:00 2001 From: fsociety Date: Wed, 2 Oct 2024 14:13:11 +0200 Subject: [PATCH] feat: update payment amount based on environment Update the amountToPay in the profile.blade.php file for the association. In the production environment, the amount will be 21000 while in other environments it will be 1 for testing purposes. Also, format the printed amount with thousands separator for better readability. --- resources/views/pages/association/profile.blade.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/pages/association/profile.blade.php b/resources/views/pages/association/profile.blade.php index cf35477..b001c1f 100644 --- a/resources/views/pages/association/profile.blade.php +++ b/resources/views/pages/association/profile.blade.php @@ -29,7 +29,7 @@ state(['events' => []]); state(['payments' => []]); state(['invoice' => null]); state(['qrCode' => null]); -state(['amountToPay' => 21000]); +state(['amountToPay' => config('app.env') === 'production' ? 21000 : 1]); state(['currentYearIsPaid' => false]); state(['currentPubkey' => null]); state(['currentPleb' => null]); @@ -58,7 +58,7 @@ on([ ]) ->where('pubkey', $pubkey)->first(); if ($this->currentPleb->association_status === \App\Enums\AssociationStatus::ACTIVE) { - $this->amountToPay = 21000; + $this->amountToPay = config('app.env') === 'production' ? 21000 : 1; } if ($this->currentPleb->paymentEvents->count() < 1) { $this->createPaymentEvent(); @@ -155,7 +155,7 @@ $createPaymentEvent = function () { $note->setContent( 'Dieses Event dient der Zahlung des Mitgliedsbeitrags für das Jahr ' . date( 'Y', - ) . '. Bitte zappe den Betrag von ' . $this->amountToPay . ' Satoshi.', + ) . '. Bitte zappe den Betrag von ' . number_format($this->amountToPay, 0, ',', '.') . ' Satoshi.', ); $note->setTags([ ['d', $this->currentPleb->pubkey . ',' . date('Y')],