#Desh
1 messages Β· Page 1 of 1 (latest)
Is that happening in all cases? or just one?
Screenshots of code are hard to work with. Can you copy/paste that code along with a request ID?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Where is the error occuring?
here:
const { setupIntent, error } = await confirmSetupIntent(ClientSecret, {
type: "Card",
paymentMethodData: {
billingDetails,
},
});
No, where is that error coming up? Console? Browser console? 3rd party app?
console from my react native project
Okay, and if you do a console.log() of billingDetails, what comes up?
ClientSecret: seti_1LzoTIJi60f9RWrmlKYn00Vw_secret_MjH1yIJEv3YgocSINeJ1Rw6MlSjso9z
billingDetails: Object {
"email": "nidianhs@gmail.com",
}
error: Object {
"code": "Failed",
"declineCode": null,
"localizedMessage": "Card details not complete",
"message": "Card details not complete",
"stripeErrorCode": null,
"type": null,
}
What all are you entering for card details when you submit the form from your browser?
Where are you entering the email?
I'm not sure what those are. Can you be more specific?
I get the email from the user's login data
Let me dig a bit on this and circle back
ok
π can you add the postal code back in and test with postal code?
Also what version of the React Native SDK are you on?
a moment
"@stripe/stripe-react-native": "0.6.1",
"expo": "~45.0.0",
"react-native": "0.68.2",
let me try
same error
K, comment out billingDetails next and re-test
console
const { setupIntent, error } = await confirmSetupIntent(ClientSecret, {
type: "Card",
paymentMethodData: {
// billingDetails,
},
});
yes
<StripeProvider
publishableKey={Configuration.stripe.publishableKey}
merchantIdentifier={Configuration.stripe.merchantIdentifier}
>
<View style={styles.contInput}>
<CardField
style={{
alignItems: "center",
height: AppStyles.size.width * 0.1,
width: AppStyles.size.width,
marginHorizontal: AppStyles.size.width * 0.05,
}}
cardStyle={{
backgroundColor: "#FFFFFF",
textColor: "#000000",
}}
postalCodeEnabled={true}
onCardChange={(details) => {
console.log("CardDetails: ", details);
}}
/>
<View style={{ marginVertical: AppStyles.size.height * 0.03 }}>
<Boton textBoton="Add new card" onSubmit={() => handlePayPress()} />
</View>
</View>
Let's try to just create a PaymentMethod
Instead of doing confirmSetupIntent do let test = await createPaymentMethod({ type: 'Card', }) console.log("test: ", test);
Yeah from stripe-react-native
okas
CardDetails: Object {
"brand": "Visa",
"complete": true,
"expiryMonth": 12,
"expiryYear": 23,
"last4": "4242",
"postalCode": "8150215",
"validCVC": "Valid",
"validExpiryDate": "Valid",
"validNumber": "Valid",
}
test: Object {
"error": Object {
"code": "Failed",
"declineCode": null,
"localizedMessage": "Card details not complete",
"message": "Card details not complete",
"stripeErrorCode": null,
"type": null,
},
}
Interesting
Okay so likely has to do with something going on with your Card Field
Like it is unmounting or something on handlePayPress
I noticed you are using a <Boton /> Component
Is that custom?
i can send you a screenshot?
yes
donΒ΄t
Have you logged out your publishable key?
yes
Are you using a FlatList?
Okay, let's try this: take out StripeProvider and let's try initStripe() instead. So something like: useEffect(() => { async function initialize() { await initStripe({ publishableKey: PUBLIC_KEY, }); } initialize().catch(console.error); }, []);
ok
The other thing to look into is how you are rendering this Component in general
Oh wait is your handlePayPress outside of your StripeCard component that is rendering CardForm?
Not positive but that might be the issue, I'd move the function inside that component.
Okay that's helpful. So you are wrapping in scrollview and stuff. Looks like there has been some reports of issues like this with Flatlists: https://github.com/stripe/stripe-react-native/issues/625. If moving the handlePayPres inside your StripeCard Component doesn't do it then I would remove all the wrapping Components temporarily and pare down to just StripeCard
Remove <ImageBackground />
Same error?
yes
You are using initStripe right now?
yep
useEffect(() => {
getInitSaveCard().then(async (resp) => {
setClientSecret(resp.client_secret);
});
async function initialize() {
await initStripe({
publishableKey: Configuration.stripe.publishableKey,
});
}
initialize().catch(console.error);
}, []);
I'll jump off the roof! hehehe
π
Jeez yeah I'm a bit stumped π¦
maybe changing the stripe version?
I mean yeah if you are willing to bump to a newer version that would definitely be a good thing to try.
Yeah that works. Expo 46 is on a newer Stripe React Native SDK
my english is bad sorry hehe
right now i have this version
"@stripe/stripe-react-native": "0.6.1",
Do you recommend an older version?
No not older
mmmm....
So if you bump to Expo 46 then you will move to 0.13.1
π
thanks