From d3ff5480b24f9469035974213cabf105a75af229 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sun, 7 Jun 2026 21:53:33 +0000 Subject: [PATCH] Use platform Paystack email and Figtree on Mini payment pages. Route Paystack receipts to pay@ladill.com instead of vendor emails, and load Figtree on the public payment and confirmation screens. Co-authored-by: Cursor --- app/Services/Mini/MiniPaymentService.php | 10 ++-------- config/services.php | 1 + resources/views/public/qr/payment-confirmed.blade.php | 4 +++- resources/views/public/qr/payment-landing.blade.php | 4 +++- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/Services/Mini/MiniPaymentService.php b/app/Services/Mini/MiniPaymentService.php index 846ea17..cbf02b7 100644 --- a/app/Services/Mini/MiniPaymentService.php +++ b/app/Services/Mini/MiniPaymentService.php @@ -33,13 +33,7 @@ class MiniPaymentService throw new RuntimeException('Enter an amount greater than zero.'); } - $qrCode->loadMissing('user.qrSetting'); - $merchant = $qrCode->user; - $email = trim((string) ($merchant?->qrSetting?->notify_email ?: $merchant?->email)); - if ($email === '' || ! str_contains($email, '@')) { - throw new RuntimeException('This payment QR is not ready yet — the vendor must add an email in Ladill Mini settings.'); - } - + $qrCode->loadMissing('user'); $amountMinor = (int) round($amountGhs * 100); $reference = 'MINP-'.strtoupper(Str::random(16)); $payRef = 'MIN-'.strtoupper(Str::random(16)); @@ -59,7 +53,7 @@ class MiniPaymentService ]); $paystackData = $this->paystack->initializeTransaction([ - 'email' => $email, + 'email' => (string) config('services.paystack.checkout_email', 'pay@ladill.com'), 'amount' => $amountMinor, 'currency' => $payment->currency, 'reference' => $payRef, diff --git a/config/services.php b/config/services.php index 458dd4d..dddac94 100644 --- a/config/services.php +++ b/config/services.php @@ -62,6 +62,7 @@ return [ 'public_key' => env('PAYSTACK_PUBLIC_KEY'), 'secret_key' => env('PAYSTACK_SECRET_KEY'), 'webhook_secret' => env('PAYSTACK_WEBHOOK_SECRET', env('PAYSTACK_SECRET_KEY')), + 'checkout_email' => env('PAYSTACK_CHECKOUT_EMAIL', 'pay@ladill.com'), ], ]; diff --git a/resources/views/public/qr/payment-confirmed.blade.php b/resources/views/public/qr/payment-confirmed.blade.php index 5a103bd..a961e03 100644 --- a/resources/views/public/qr/payment-confirmed.blade.php +++ b/resources/views/public/qr/payment-confirmed.blade.php @@ -4,9 +4,11 @@ Payment confirmed + + @vite(['resources/css/app.css']) - +
diff --git a/resources/views/public/qr/payment-landing.blade.php b/resources/views/public/qr/payment-landing.blade.php index e789c30..d0ed4a3 100644 --- a/resources/views/public/qr/payment-landing.blade.php +++ b/resources/views/public/qr/payment-landing.blade.php @@ -12,9 +12,11 @@ Pay {{ $businessName }} + + @vite(['resources/css/app.css', 'resources/js/app.js']) -