mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 10:53:23 +00:00
feat: Add support for provider-level configuration in billing plugin
- Introduce `onConfig` callback for payment providers - Add dynamic endpoint registration for Mollie webhook handling - Remove unused provider-specific configurations from plugin types - Update initialization to include provider-level configurations
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import type { Payment } from '@/plugin/types/payments'
|
||||
import type { Payload } from 'payload'
|
||||
import type { Config, Payload } from 'payload'
|
||||
import type { BillingPluginConfig } from '@/plugin/config'
|
||||
|
||||
export type InitPayment = (payload: Payload, payment: Partial<Payment>) => Promise<Partial<Payment>>
|
||||
|
||||
export type PaymentProvider = {
|
||||
key: string
|
||||
onInit: (payload: Payload) => Promise<void> | void
|
||||
onConfig?: (config: Config, pluginConfig: BillingPluginConfig) => void
|
||||
onInit?: (payload: Payload) => Promise<void> | void
|
||||
initPayment: InitPayment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user