Skip to content

Commit

Permalink
Remove payment_method_creation from types (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsang-stripe committed Dec 11, 2023
1 parent 0309bef commit 31b50b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 6 additions & 2 deletions tests/types/src/invalid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ declare const paymentElement: StripePaymentElement;
declare const cartElement: StripeCartElement;
declare const expressCheckoutElement: StripeExpressCheckoutElement;

// @ts-expect-error: Passing `clientSecret` or `mode` implies different integration paths which cannot be combined
const options: StripeElementsOptions = {clientSecret: '', mode: ''};
const options: StripeElementsOptions = {
clientSecret: '',
// @ts-expect-error Type 'string' is not assignable to type '"payment" | "setup" | "subscription" | undefined'.ts(2322)
mode: '',
payment_method_creation: 'manual',
};

// @ts-expect-error: Passing `clientSecret` or `mode` implies different integration paths which cannot be combined
const elements = stripe.elements(options);
Expand Down
1 change: 0 additions & 1 deletion tests/types/src/valid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ stripe.elements({
setup_future_usage: 'off_session',
capture_method: 'automatic',
payment_method_types: ['card'],
payment_method_creation: 'manual',
payment_method_options: {
us_bank_account: {financial_connections: {permissions: ['payment_method']}},
},
Expand Down
5 changes: 0 additions & 5 deletions types/stripe-js/elements-group.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,6 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
*/
paymentMethodCreation?: 'manual';

/**
* Allows PaymentMethods to be created from the Elements instance.
*/
payment_method_creation?: 'manual';

/**
* Additional payment-method-specific options for configuring Payment Element behavior.
*
Expand Down

0 comments on commit 31b50b6

Please sign in to comment.