added crypto pm and activation key system

This commit is contained in:
Gitea
2025-05-16 11:24:08 +05:30
parent 23b5a45d0b
commit 93515e7845
11 changed files with 454 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
<div class="mx-auto max-w-3xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 ">
<script src="https://shoppy.gg/api/embed.js"></script>
<div class="w-full mb-8 items-center flex justify-center">
<h1 class="text-center text-3xl text-gray-900 dark:text-gray-200">Purchase Subscription</h1>
</div>
@@ -35,12 +36,70 @@
@endif
</ul>
@if($plan->accept_stripe && $plan->pricing_id !== null)
<flux:button variant="primary" class="w-full mt-6 cursor-pointer" wire:click="choosePlan('{{ $plan->pricing_id }}')">
Choose Plan
Pay with card
</flux:button>
@endif
@if($plan->accept_shoppy && $plan->shoppy_product_id !== null)
<flux:button variant="filled" class="w-full mt-2 cursor-pointer" data-shoppy-product="{{ $plan->shoppy_product_id }}">
Pay with crypto
</flux:button>
@endif
</div>
@endforeach
@endif
</div>
<div class="w-full mt-8">
<flux:separator text="or" />
<div class="w-full mt-4 mb-8 items-center flex justify-center">
<h1 class="text-center text-3xl text-gray-900 dark:text-gray-200">Have an Activation Key?</h1>
</div>
<div class="flex rounded-lg overflow-hidden border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-zinc-800">
<input
type="text"
wire:model="activation_key"
class="w-full px-4 py-2 bg-white dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 placeholder-zinc-500 focus:outline-none"
placeholder="Enter your activation key"
/>
<button
wire:click="activateKey"
class="cursor-pointer px-5 text-white transition-colors dark:text-white bg-[#4361EE] dark:bg-[#4361EE] disabled:bg-gray-400 disabled:cursor-not-allowed"
:disabled="wire:loading"
>
<!-- Show Loader when loading -->
<span wire:loading.remove>Activate</span>
<span wire:loading class="flex justify-center items-center px-4">
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_7NYg{animation:spinner_0KQs 1.2s cubic-bezier(0.52,.6,.25,.99) infinite}@keyframes spinner_0KQs{0%{r:0;opacity:1}100%{r:11px;opacity:0}}</style><circle class="spinner_7NYg" cx="12" cy="12" r="0" fill="white"/></svg>
</span>
</button>
</div>
<div class="mt-2 text-center text-sm text-gray-500 dark:text-gray-400">
Redeem your activation key, purchased with Pay with Crypto option.
</div>
<div class="mt-3">
@error('activation_key')
<div class="mt-4 app-primary">
{{ $message }}
</div>
@enderror
<!-- Success/Error Message -->
@if (session()->has('success'))
<div class="mt-4" style="color: #00AB55">
{{ session('success') }}
</div>
@endif
@if (session()->has('error'))
<div class="mt-4 text-green-700">
{{ session('error') }}
</div>
@endif
</div>
</div>
</div>