mirror of
https://github.com/xtr-dev/payload-billing.git
synced 2025-12-10 02:43:24 +00:00
feat: Add Mollie payment provider support
- Introduce `mollieProvider` for handling Mollie payments - Add configurable payment hooks for initialization and processing - Implement `initPayment` logic to create Mollie payments and update metadata - Include types for Mollie integration in payments and refunds - Update `package.json` to include `@mollie/api-client` dependency - Refactor existing payment-related types into modular files for better maintainability
This commit is contained in:
@@ -8,6 +8,7 @@ import { fileURLToPath } from 'url'
|
||||
import { testEmailAdapter } from './helpers/testEmailAdapter'
|
||||
import { seed } from './seed'
|
||||
import billingPlugin from '../src/plugin'
|
||||
import { mollieProvider } from '../src/providers'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
@@ -48,38 +49,16 @@ const buildConfigWithSQLite = () => {
|
||||
},
|
||||
plugins: [
|
||||
billingPlugin({
|
||||
providers: {
|
||||
test: {
|
||||
enabled: true,
|
||||
autoComplete: true,
|
||||
}
|
||||
},
|
||||
providers: [
|
||||
mollieProvider({
|
||||
apiKey: process.env.MOLLIE_KEY!
|
||||
})
|
||||
],
|
||||
collections: {
|
||||
payments: 'payments',
|
||||
invoices: 'invoices',
|
||||
refunds: 'refunds',
|
||||
},
|
||||
// // Customer relationship configuration
|
||||
// customerRelationSlug: 'customers', // Use 'customers' collection for relationship
|
||||
// // customerRelationSlug: false, // Or set to false to disable customer relationship
|
||||
// // customerRelationSlug: 'clients', // Or use a custom collection slug
|
||||
//
|
||||
// // Provide an extractor for your customer collection structure:
|
||||
// customerInfoExtractor: (customer) => ({
|
||||
// name: customer.name || '',
|
||||
// email: customer.email || '',
|
||||
// phone: customer.phone,
|
||||
// company: customer.company,
|
||||
// taxId: customer.taxId,
|
||||
// billingAddress: customer.address ? {
|
||||
// line1: customer.address.line1 || '',
|
||||
// line2: customer.address.line2,
|
||||
// city: customer.address.city || '',
|
||||
// state: customer.address.state,
|
||||
// postalCode: customer.address.postalCode || '',
|
||||
// country: customer.address.country || '',
|
||||
// } : undefined,
|
||||
// })
|
||||
}),
|
||||
],
|
||||
secret: process.env.PAYLOAD_SECRET || 'test-secret_key',
|
||||
|
||||
Reference in New Issue
Block a user