mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 02:43:24 +00:00
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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user