#.pecivko
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can I start off by asking you what the version of stripe-react-native you are using?
0.28.0
And you are passing in the BillingDetails when you initialize your PaymentSheet?
https://stripe.dev/stripe-react-native/api-reference/interfaces/BillingDetails.html
As the defaultBillingDetails?: BillingDetails parameter?
I'm looking here btw: https://stripe.dev/stripe-react-native/api-reference/modules/PaymentSheet.html
const { error } = await initPaymentSheet({ paymentIntentClientSecret: clientSecret, merchantDisplayName: "", defaultBillingDetails: { name: firstName + " " + lastName, phone: phoneNumber, address: { country: "SK", city: address.city, postalCode: address.zipCode, }, }, applePay: { merchantCountryCode: "SK", }, googlePay: { merchantCountryCode: "SK", }, });
this is what i am doing
If you already have these details could you just prevent address collection?
Using the BillingDetailsCollectionConfiguration with each field set to NEVER?
https://stripe.dev/stripe-react-native/api-reference/modules/PaymentSheet.html#BillingDetailsCollectionConfiguration
https://stripe.dev/stripe-react-native/api-reference/enums/PaymentSheet.CollectionMode.html#NEVER
An import error now occured :
Unable to resolve "@stripe/stripe-react-native/lib/typescript/src/types/PaymentSheet"
when i try to import the CollectionMode and AdrressCollectionMode
I will get back when i fix it
Interesting ๐ง
Seems strange to me when i am normally using types for the same file
I agree. I can see these two enums here: https://github.com/stripe/stripe-react-native/blob/master/src/types/PaymentSheet.ts#L297-L313
I am using expo btw, i forgot to mention it in the begining ๐
Oh wait. those enums don't exist in PaymentSheet for v0.28.0
i mean when i go to my node_modules and i track down the file it is there so i do not really understand
Yes but this path @stripe/stripe-react-native/lib/typescript/src/types/PaymentSheet refers to this file:
https://github.com/stripe/stripe-react-native/blob/v0.28.0/src/types/PaymentSheet.ts
I adjusted the Tag so it corresponds to the right version
So should i just update my npm package and try again ?
Try upgrading your "@stripe/stripe-react-native": "^0.35.0", in package.json
The error still persists
๐ Stepping in for my teammate. What error persists exactly? Is it the import error or something else?
Yes, its the import error when i try to call initPaymentSheet, and configurate the biligin collection billingDetailsCollectionConfiguration: { phone: CollectionMode.NEVER, address: AddressCollectionMode.NEVER, name: CollectionMode.NEVER, }, I get an import error Unable to resolve "@stripe/stripe-react-native/lib/typescript/src/types/PaymentSheet"
My problem is that i want to prefill billing address so that apple pay does not ask the user to sumbit the address in order to use apple pay. I have tried setting the defaultBillingDetails but it does not do the trick
So your teamate suggested i try to set data colection to NEVER and the import error appeared
Got it. I'm not a React Native expert so will try to help as best as I can. Instead of using NEVER, can you go back to trying to pass SK and address.zipCode for defaultBillingDetails ?
I'm suggesting that as comments in the library mention the following:
/** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */
The error persists
I have to go for today, thank you for your help so far i will probably contact you again tommorow
Sorry we couldn't get to the bottom of this today!