revert: remove testmode parameter from Mollie payment creation

Removed the testmode parameter as it was causing issues. Mollie will
automatically determine test/live mode based on the API key used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-05 15:22:37 +01:00
parent 1eb9d282b3
commit 20030b435c
2 changed files with 2 additions and 13 deletions

View File

@@ -17,13 +17,6 @@ import { createContextLogger } from '../utils/logger'
const symbol = Symbol.for('@xtr-dev/payload-billing/mollie')
export type MollieProviderConfig = Parameters<typeof createMollieClient>[0]
/**
* Determine if testmode should be enabled based on API key prefix
*/
function isTestMode(apiKey: string): boolean {
return apiKey.startsWith('test_')
}
/**
* Type-safe mapping of Mollie payment status to internal status
*/
@@ -168,9 +161,6 @@ export const mollieProvider = (mollieConfig: MollieProviderConfig & {
validateProductionUrl(redirectUrl, 'Redirect')
validateProductionUrl(webhookUrl, 'Webhook')
// Determine testmode from API key (test_ prefix = true)
const testmode = isTestMode(mollieConfig.apiKey)
const molliePayment = await singleton.get(payload).payments.create({
amount: {
value: formatAmountForProvider(payment.amount, payment.currency),
@@ -179,8 +169,7 @@ export const mollieProvider = (mollieConfig: MollieProviderConfig & {
description: payment.description || '',
redirectUrl,
webhookUrl,
testmode,
} as any);
});
payment.providerId = molliePayment.id
// Use toPlainObject if available, otherwise spread the object (for compatibility with different Mollie client versions)
payment.providerData = typeof molliePayment.toPlainObject === 'function'