mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
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.
This commit is contained in:
@@ -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')],
|
||||
|
||||
Reference in New Issue
Block a user