fix: hardcode domain in payment link generation to prevent localhost

This commit is contained in:
mstfyldz
2026-03-14 00:58:00 +03:00
parent 2959c24a75
commit 8800454b60

View File

@@ -203,9 +203,7 @@ export default function MerchantsPage() {
</div>
) : merchants.map((m) => {
const identifier = m.short_id || m.id;
const paymentLink = typeof window !== 'undefined'
? `${window.location.origin}/checkout?merchant_id=${identifier}&amount=0`
: `https://p2cgateway.store/checkout?merchant_id=${identifier}&amount=0`;
const paymentLink = `https://p2cgateway.store/checkout?merchant_id=${identifier}&amount=0`;
return (
<div key={m.id} className="bg-white rounded-[40px] border border-gray-100 p-8 shadow-sm hover:shadow-md transition-shadow group">
@@ -319,7 +317,7 @@ export default function MerchantsPage() {
className="text-[11px] font-mono truncate text-gray-500 hover:text-blue-600 transition-colors flex-1 flex items-center gap-1.5"
title="Linki Aç"
>
{typeof window !== 'undefined' ? window.location.origin : 'https://p2cgateway.store'}/checkout?merchant_id=<span className="text-blue-600 font-bold">{identifier}</span>&amount=<span className="text-emerald-500 font-bold">0</span>
https://p2cgateway.store/checkout?merchant_id=<span className="text-blue-600 font-bold">{identifier}</span>&amount=<span className="text-emerald-500 font-bold">0</span>
<ExternalLink size={10} className="opacity-0 group-hover/link:opacity-100 transition-opacity" />
</a>
</div>