From 2774c94a86af00ebb5e0ca0de7587237cce3614b Mon Sep 17 00:00:00 2001 From: Ari Bahtiar Date: Tue, 14 Apr 2026 11:43:01 +0700 Subject: [PATCH 1/6] fix checkout v2 domain --- apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx index ad712f31d5e1b0..fde365c3067fd1 100644 --- a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx +++ b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx @@ -41,7 +41,8 @@ export const HitpayPaymentComponent = (props: IPaymentComponentProps) => { if (parsedData.success) { if (window.self !== window.top && window.top) { if (!isInitialized) { - const subUrl = parsedData.data.url.substring("https://securecheckout.".length); + const isCheckoutV1 = parsedData.data.url.includes("https://securecheckout."); + const subUrl = isCheckoutV1 ?parsedData.data.url.substring("https://securecheckout.".length) : parsedData.data.url.substring("https://checkout.".length); const arr = subUrl.split("/"); const domain = arr[0]; From 2f0903a9c6f87cbc1c2200304b5f67886e3bcdd6 Mon Sep 17 00:00:00 2001 From: Ari Bahtiar Date: Tue, 14 Apr 2026 12:10:33 +0700 Subject: [PATCH 2/6] fix init HitPayDropIn --- apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx index fde365c3067fd1..d5a44f3c401fdb 100644 --- a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx +++ b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx @@ -41,15 +41,10 @@ export const HitpayPaymentComponent = (props: IPaymentComponentProps) => { if (parsedData.success) { if (window.self !== window.top && window.top) { if (!isInitialized) { - const isCheckoutV1 = parsedData.data.url.includes("https://securecheckout."); - const subUrl = isCheckoutV1 ?parsedData.data.url.substring("https://securecheckout.".length) : parsedData.data.url.substring("https://checkout.".length); - const arr = subUrl.split("/"); - const domain = arr[0]; - init( parsedData.data.defaultLink || "", { - domain, + 'hit-pay.com' }, { paymentRequest: parsedData.data.id, From 23ce1acc52cc8d47aa85cabd3d2e2a70a661ec1d Mon Sep 17 00:00:00 2001 From: Ari Bahtiar Date: Tue, 14 Apr 2026 12:12:49 +0700 Subject: [PATCH 3/6] fix domain --- apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx index d5a44f3c401fdb..cc8a86e53aeb6b 100644 --- a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx +++ b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx @@ -44,7 +44,7 @@ export const HitpayPaymentComponent = (props: IPaymentComponentProps) => { init( parsedData.data.defaultLink || "", { - 'hit-pay.com' + domain : 'hit-pay.com', }, { paymentRequest: parsedData.data.id, From 314fe6e312bb187bc64ad135c934c4b60801b033 Mon Sep 17 00:00:00 2001 From: Ari Bahtiar Date: Tue, 14 Apr 2026 12:15:56 +0700 Subject: [PATCH 4/6] fix checkout v2 domain --- apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx index cc8a86e53aeb6b..fde365c3067fd1 100644 --- a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx +++ b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx @@ -41,10 +41,15 @@ export const HitpayPaymentComponent = (props: IPaymentComponentProps) => { if (parsedData.success) { if (window.self !== window.top && window.top) { if (!isInitialized) { + const isCheckoutV1 = parsedData.data.url.includes("https://securecheckout."); + const subUrl = isCheckoutV1 ?parsedData.data.url.substring("https://securecheckout.".length) : parsedData.data.url.substring("https://checkout.".length); + const arr = subUrl.split("/"); + const domain = arr[0]; + init( parsedData.data.defaultLink || "", { - domain : 'hit-pay.com', + domain, }, { paymentRequest: parsedData.data.id, From 45228fcbd4d54163590b3e10e39536d903907e0b Mon Sep 17 00:00:00 2001 From: Ari Bahtiar Date: Tue, 14 Apr 2026 12:20:03 +0700 Subject: [PATCH 5/6] fix --- apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx index fde365c3067fd1..3164a90cc0cb9f 100644 --- a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx +++ b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx @@ -42,7 +42,7 @@ export const HitpayPaymentComponent = (props: IPaymentComponentProps) => { if (window.self !== window.top && window.top) { if (!isInitialized) { const isCheckoutV1 = parsedData.data.url.includes("https://securecheckout."); - const subUrl = isCheckoutV1 ?parsedData.data.url.substring("https://securecheckout.".length) : parsedData.data.url.substring("https://checkout.".length); + const subUrl = isCheckoutV1 ? parsedData.data.url.substring("https://securecheckout.".length) : parsedData.data.url.substring("https://checkout.".length); const arr = subUrl.split("/"); const domain = arr[0]; From f34d5c6a4a99dda65475cd269535639f92d9d646 Mon Sep 17 00:00:00 2001 From: Ari Bahtiar Date: Tue, 14 Apr 2026 17:32:43 +0700 Subject: [PATCH 6/6] get domain from checkout link --- .../apps/hitpay/HitpayPaymentComponent.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx index 3164a90cc0cb9f..692373f722b19a 100644 --- a/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx +++ b/apps/web/components/apps/hitpay/HitpayPaymentComponent.tsx @@ -37,14 +37,20 @@ export const HitpayPaymentComponent = (props: IPaymentComponentProps) => { const parsedData = PaymentHitpayDataSchema.safeParse(data); + const getDomainFromCheckoutUrl = (urlString: string) => { + const { hostname } = new URL(urlString); + + return hostname + .replace(/^securecheckout\./, "") + .replace(/^checkout\./, ""); + }; + useEffect(() => { if (parsedData.success) { if (window.self !== window.top && window.top) { if (!isInitialized) { - const isCheckoutV1 = parsedData.data.url.includes("https://securecheckout."); - const subUrl = isCheckoutV1 ? parsedData.data.url.substring("https://securecheckout.".length) : parsedData.data.url.substring("https://checkout.".length); - const arr = subUrl.split("/"); - const domain = arr[0]; + + const domain = getDomainFromCheckoutUrl(parsedData.data.url); init( parsedData.data.defaultLink || "",