paynym support added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-17 11:49:11 +01:00
parent d9bf8a730a
commit 6979c554bc
20 changed files with 147 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
'lightning_address' => ['nullable', 'string'],
'lnurl' => ['nullable', 'string'],
'nostr' => ['nullable', 'string'],
'paynym' => ['nullable', 'string'],
'node_id' => ['nullable', 'string', 'max:66'],
'timezone' => ['required', 'string'],
'email' => [
@@ -44,6 +45,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
'lightning_address' => $input['lightning_address'],
'lnurl' => $input['lnurl'],
'nostr' => $input['nostr'],
'paynym' => $input['paynym'],
'node_id' => $input['node_id'],
'email' => $input['email'],
'timezone' => $input['timezone'],
@@ -65,6 +67,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
'lnurl' => $input['lnurl'],
'node_id' => $input['node_id'],
'nostr' => $input['nostr'],
'paynym' => $input['paynym'],
'email' => $input['email'],
'timezone' => $input['timezone'],
'email_verified_at' => null,

View File

@@ -32,6 +32,7 @@ class ContentCreatorForm extends Component
'lecturer.active' => 'boolean',
'lecturer.subtitle' => 'nullable|string',
'lecturer.intro' => 'nullable|string',
'lecturer.paynym' => 'nullable|string',
'lecturer.nostr' => 'nullable|string',
'lecturer.twitter_username' => 'nullable|string',
'lecturer.website' => 'nullable|url',

View File

@@ -26,6 +26,8 @@ class InternArticleView extends Component
public bool $invoicePaid = false;
public bool $alreadyPaid = false;
public ?string $payNymQrCode = '';
public function mount()
{
$this->libraryItem->load([
@@ -42,6 +44,22 @@ class InternArticleView extends Component
->count() > 0) {
$this->invoicePaid = true;
}
if ($this->libraryItem->lecturer->paynym) {
$this->payNymQrCode = base64_encode(QrCode::format('png')
->size(300)
->merge($this->libraryItem->lecturer->getFirstMedia('avatar')
? str(
$this->libraryItem
->lecturer
->getFirstMediaPath('avatar'))
->replace('/home/einundzwanzig/portal.einundzwanzig.space',
''
)
: '/public/img/einundzwanzig.png',
.3)
->errorCorrection('H')
->generate($this->libraryItem->lecturer->paynym));
}
}
public function pay()

View File

@@ -75,11 +75,13 @@ class User extends Authenticatable implements MustVerifyEmail, CanComment, Ciphe
->addField('lnurl')
->addField('node_id')
->addField('email')
->addField('paynym')
->addJsonField('lnbits', $map)
->addBlindIndex('public_key', new BlindIndex('public_key_index'))
->addBlindIndex('lightning_address', new BlindIndex('lightning_address_index'))
->addBlindIndex('lnurl', new BlindIndex('lnurl_index'))
->addBlindIndex('node_id', new BlindIndex('node_id_index'))
->addBlindIndex('paynym', new BlindIndex('paynym_index'))
->addBlindIndex('email', new BlindIndex('email_index'));
}

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->text('paynym')
->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
//
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('lecturers', function (Blueprint $table) {
$table->text('paynym')
->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('lecturers', function (Blueprint $table) {
//
});
}
};

View File

@@ -857,5 +857,8 @@
"articles": "Artikel",
"Participation confirmed": "Teilnahme bestätigt",
"There was an error on row :row. :message": "Es gab einen Fehler in Zeile :row. :message",
"Calendar Stream-Url for my meetups only": "Kalender-Stream-Url nur für meine Meetups"
"Calendar Stream-Url for my meetups only": "Kalender-Stream-Url nur für meine Meetups",
"Avatar\/Picture": "Avatar\/Bild",
"PayNym": "",
"starts with PM...": "startet mit PM..."
}

View File

@@ -857,5 +857,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -857,5 +857,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -858,5 +858,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -858,5 +858,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -858,5 +858,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -858,5 +858,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -858,5 +858,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -858,5 +858,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -820,5 +820,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -832,5 +832,8 @@
"Perhabs": "",
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
"Calendar Stream-Url for my meetups": "",
"Avatar\/Picture": "",
"PayNym": "",
"starts with PM...": ""
}

View File

@@ -20,7 +20,7 @@
<div class="space-y-8 divide-y divide-gray-700 sm:space-y-5">
<div class="mt-6 sm:mt-5 space-y-6 sm:space-y-5">
<x-input.group :for=" md5('image')" :label="__('Main picture')">
<x-input.group :for=" md5('image')" :label="__('Avatar/Picture')">
<div class="py-4">
@if ($image)
<div class="text-gray-200">{{ __('Preview') }}:</div>
@@ -69,6 +69,11 @@
:placeholder="__('Website')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.paynym')" :label="__('PayNym')">
<x-input autocomplete="off" wire:model.debounce="lecturer.paynym"
:placeholder="__('PayNym')" :hint="__('starts with PM...')"/>
</x-input.group>
<x-input.group :for="md5('lecturer.lightning_address')" :label="__('Lightning Address')">
<x-input autocomplete="off" wire:model.debounce="lecturer.lightning_address"
:placeholder="__('Lightning Address')" :hint="__('for example xy@getalby.com')"/>

View File

@@ -264,6 +264,13 @@
</div>
@endif
@if($payNymQrCode)
<div class="flex flex-col sm:flex-row justify-center space-x-4 border-t border-white py-4 mt-4">
<h1 class="text-2xl text-gray-200">PayNym</h1>
<img src="{{ 'data:image/png;base64, '. $payNymQrCode }}" alt="qrcode">
</div>
@endif
<div wire:ignore>
<div class="flex flex-col sm:flex-row justify-center space-x-4 border-t border-white py-4 mt-4">
@if($libraryItem->lecturer->lightning_address || $libraryItem->lecturer->lnurl || $libraryItem->lecturer->node_id)

View File

@@ -73,6 +73,16 @@
<x-jet-input-error for="nostr" class="mt-2"/>
</div>
<!-- paynym -->
<div class="col-span-6 sm:col-span-4">
<x-jet-label for="paynym" value="{{ __('PayNym') }}"/>
<x-jet-input id="paynym" type="text" class="mt-1 block w-full"
wire:model.defer="state.paynym"
autocomplete="paynym"/>
<p class="text-xs">{{ __('starts with PM...') }}</p>
<x-jet-input-error for="paynym" class="mt-2"/>
</div>
<!-- lightning_address -->
<div class="col-span-6 sm:col-span-4">
<x-jet-label for="lightning_address" value="{{ __('Lightning Address') }}"/>