mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 10:53:23 +00:00
- Remove .js extensions from all TypeScript imports throughout codebase - Update dev config to use testProvider instead of mollieProvider for testing - Fix module resolution issues preventing development server startup - Enable proper testing of billing plugin functionality with test provider This resolves the "Module not found: Can't resolve" errors that were preventing the development server from starting with Next.js/Turbopack. All TypeScript imports now use extension-less imports as required. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
12 lines
495 B
TypeScript
12 lines
495 B
TypeScript
import type { Payment } from '../plugin/types/index'
|
|
import type { Payload } from 'payload'
|
|
import { useBillingPlugin } from '../plugin/index'
|
|
|
|
export const initProviderPayment = (payload: Payload, payment: Partial<Payment>) => {
|
|
const billing = useBillingPlugin(payload)
|
|
if (!payment.provider || !billing.providerConfig[payment.provider]) {
|
|
throw new Error(`Provider ${payment.provider} not found.`)
|
|
}
|
|
return billing.providerConfig[payment.provider].initPayment(payload, payment)
|
|
}
|