mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 19:03:23 +00:00
fix: use built-in UI when customUiRoute is not specified
In v0.1.19, the fix for customUiRoute made it always use the default route '/test-payment' even when customUiRoute was not specified. This caused 404 errors because users were unaware of this default behavior. The plugin actually provides a built-in test payment UI at /api/payload-billing/test/payment/:id that works out of the box. This fix ensures the correct behavior: - When customUiRoute IS specified: Use the custom route - When customUiRoute is NOT specified: Use the built-in UI route This allows the testProvider to work out of the box without requiring users to implement a custom test payment page, while still supporting custom implementations when needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -492,7 +492,10 @@ export const testProvider = (testConfig: TestProviderConfig) => {
|
||||
|
||||
// Set provider ID and data
|
||||
payment.providerId = testPaymentId
|
||||
const paymentUrl = `${baseUrl}${uiRoute}/${testPaymentId}`
|
||||
// Use custom UI route if specified, otherwise use built-in UI endpoint
|
||||
const paymentUrl = testConfig.customUiRoute
|
||||
? `${baseUrl}${testConfig.customUiRoute}/${testPaymentId}`
|
||||
: `${baseUrl}/api/payload-billing/test/payment/${testPaymentId}`
|
||||
const providerData: ProviderData = {
|
||||
raw: {
|
||||
id: testPaymentId,
|
||||
|
||||
Reference in New Issue
Block a user