fix: resolve critical template literal and error handling issues

Critical fixes:
- Fix template literal bug in paymentId that prevented payment processing
- Enhance error handling to update both session and database on failures
- Consolidate duplicate type definitions to single source of truth

Technical details:
- Template literal interpolation now properly provides actual session IDs
- Promise rejections in setTimeout now update payment records in database
- Removed duplicate AdvancedTestProviderConfig, now re-exports TestProviderConfig
- Enhanced error handling with comprehensive database state consistency

Prevents payment processing failures and data inconsistency issues.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-19 11:19:05 +02:00
parent 2d10bd82e7
commit be57924525
2 changed files with 33 additions and 21 deletions

View File

@@ -19,25 +19,8 @@ export interface TestProviderConfig {
simulateFailures?: boolean
}
export interface AdvancedTestProviderConfig {
enabled: boolean
scenarios?: Array<{
id: string
name: string
description: string
outcome: 'paid' | 'failed' | 'cancelled' | 'expired' | 'pending'
delay?: number
method?: 'ideal' | 'creditcard' | 'paypal' | 'applepay' | 'banktransfer'
}>
customUiRoute?: string
testModeIndicators?: {
showWarningBanners?: boolean
showTestBadges?: boolean
consoleWarnings?: boolean
}
defaultDelay?: number
baseUrl?: string
}
// Re-export the actual test provider config instead of duplicating
export type { TestProviderConfig as AdvancedTestProviderConfig } from '../providers/test.js'
// Customer info extractor callback type
export interface CustomerInfoExtractor {