From 79166f7edf70e7961a980f1d9b39143f309f2e87 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Fri, 21 Nov 2025 16:17:38 +0100 Subject: [PATCH] fix: respect customUiRoute configuration in test provider MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test provider's customUiRoute parameter was being ignored when generating checkout URLs. The checkout URL was always using the hardcoded API endpoint instead of the configured custom UI route. This fix ensures that when customUiRoute is configured, the generated checkoutUrl will use the custom route (e.g., /test-payment/:id) instead of the default API route. Fixes issue where test provider checkout URLs returned 404 errors because they pointed to /api/payload-billing/test/payment/:id instead of the configured custom UI route. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- package.json | 2 +- src/providers/test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2880255..aa1854e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xtr-dev/payload-billing", - "version": "0.1.18", + "version": "0.1.19", "description": "PayloadCMS plugin for billing and payment provider integrations with tracking and local testing", "license": "MIT", "type": "module", diff --git a/src/providers/test.ts b/src/providers/test.ts index 644e23d..c9d6d0d 100644 --- a/src/providers/test.ts +++ b/src/providers/test.ts @@ -492,7 +492,7 @@ export const testProvider = (testConfig: TestProviderConfig) => { // Set provider ID and data payment.providerId = testPaymentId - const paymentUrl = `${baseUrl}/api/payload-billing/test/payment/${testPaymentId}` + const paymentUrl = `${baseUrl}${uiRoute}/${testPaymentId}` const providerData: ProviderData = { raw: { id: testPaymentId,