stripe-react-native
stripe-react-native copied to clipboard
Cannot import CollectionMode and AddressCollectionMode
Describe the bug A clear and concise description of what the bug is.
To Reproduce
import { AddressCollectionMode, CollectionMode } from '@stripe/stripe-react-native/lib/typescript/src/types/PaymentSheet';
Unable to resolve "@stripe/stripe-react-native/lib/typescript/src/types/PaymentSheet"
import { AddressCollectionMode, CollectionMode } from '@stripe/stripe-react-native'; does not work either
Additional context Stripe RN version: 0.27.2
Just found out the correct access is document here: https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#collect-billing-details
billingDetailsCollectionConfiguration: {
address: PaymentSheet.AddressCollectionMode.NEVER,
email: PaymentSheet.CollectionMode.NEVER,
name: PaymentSheet.CollectionMode.NEVER,
phone: PaymentSheet.CollectionMode.NEVER,
},
I am just gonna note that it is not intuitive since IDEs will probably hint to import from @stripe/stripe-react-native/lib/typescript/src/types/PaymentSheet
this import also works:
import { AddressCollectionMode, CollectionMode } from '@stripe/stripe-react-native/src/types/PaymentSheet';