From 38c8c3677d1abc580a0d092f97ef270b4d44e8a6 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:51:01 +0000 Subject: [PATCH] fix: remove non-existent defaultCustomerInfoExtractor from README Replace defaultCustomerInfoExtractor import and usage with a proper working example that shows how to define a CustomerInfoExtractor function. Co-authored-by: Bas --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ecca38..3f49c53 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,24 @@ export default buildConfig({ ### With Customer Management ```typescript -import { billingPlugin, defaultCustomerInfoExtractor } from '@xtr-dev/payload-billing' +import { billingPlugin, CustomerInfoExtractor } from '@xtr-dev/payload-billing' + +// Define how to extract customer info from your customer collection +const customerExtractor: CustomerInfoExtractor = (customer) => ({ + name: customer.name, + email: customer.email, + phone: customer.phone, + company: customer.company, + taxId: customer.taxId, + billingAddress: { + line1: customer.address.line1, + line2: customer.address.line2, + city: customer.address.city, + state: customer.address.state, + postalCode: customer.address.postalCode, + country: customer.address.country, + } +}) billingPlugin({ // ... providers @@ -87,7 +104,7 @@ billingPlugin({ refunds: 'refunds', }, customerRelationSlug: 'customers', // Enable customer relationships - customerInfoExtractor: defaultCustomerInfoExtractor, // Auto-sync customer data + customerInfoExtractor: customerExtractor, // Auto-sync customer data }) ```