Skip to content

Commit

Permalink
feat(wabe-stripe): add invoice_creation param (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
coratgerl authored Dec 21, 2024
1 parent 04f833d commit 34e2049
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/wabe-stripe/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ describe('wabe-stripe', () => {
automatic_tax: {
enabled: false,
},
invoice_creation: {
enabled: true,
},
})
})

Expand Down
4 changes: 4 additions & 0 deletions packages/wabe-stripe/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export class StripeAdapter implements PaymentAdapter {
currency,
automaticTax,
recurringInterval,
createInvoice = true,
}: CreatePaymentOptions) {
const customersWithSameEmail = await this.stripe.customers.list({
email: customerEmail,
Expand Down Expand Up @@ -178,6 +179,9 @@ export class StripeAdapter implements PaymentAdapter {
automatic_tax: {
enabled: !!automaticTax,
},
invoice_creation: {
enabled: createInvoice,
},
...(automaticTax
? {
billing_address_collection: 'required',
Expand Down
1 change: 1 addition & 0 deletions packages/wabe/src/payment/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export type CreatePaymentOptions = {
cancelUrl: string
automaticTax?: boolean
recurringInterval?: 'month' | 'year'
createInvoice?: boolean
}

export type InitWebhookOptions = {
Expand Down

0 comments on commit 34e2049

Please sign in to comment.