fix: hardcode domain in payment link generation to prevent localhost
This commit is contained in:
@@ -203,9 +203,7 @@ export default function MerchantsPage() {
|
|||||||
</div>
|
</div>
|
||||||
) : merchants.map((m) => {
|
) : merchants.map((m) => {
|
||||||
const identifier = m.short_id || m.id;
|
const identifier = m.short_id || m.id;
|
||||||
const paymentLink = typeof window !== 'undefined'
|
const paymentLink = `https://p2cgateway.store/checkout?merchant_id=${identifier}&amount=0`;
|
||||||
? `${window.location.origin}/checkout?merchant_id=${identifier}&amount=0`
|
|
||||||
: `https://p2cgateway.store/checkout?merchant_id=${identifier}&amount=0`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={m.id} className="bg-white rounded-[40px] border border-gray-100 p-8 shadow-sm hover:shadow-md transition-shadow group">
|
<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"
|
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ç"
|
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" />
|
<ExternalLink size={10} className="opacity-0 group-hover/link:opacity-100 transition-opacity" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user