#gilbot-reactnative-error
1 messages · Page 1 of 1 (latest)
Hello @haughty bobcat can you share the doc you are following and your exact code for the confirm part?
🤞
damn nvm heres out code snippet
const { paymentIntent, error } = await confirmPayment(clientSecret, {
paymentMethodType: 'Card',
paymentMethodData: {
billingDetails: {
phone: +${userDetails?.phone ?? ''},
},
},
});
if (error) {
// do something
console.log('error', error);
}
if (paymentIntent) {
console.log('sdfsdf', paymentIntent);
// payment is successful. create order
}
},
@twin dome for context when creating the card paymentMethod, im supplying the card number, exp month, exp year, cvc and postal code. Does this expect any additional information?
Looking
What do you mean you are "creating a paymentMethod" since you aren't doing that here? You're just confirming the PaymentIntent right?
correct right here im just confirming the paymentIntent
so you are not creating the PaymentMethod? What's the exact output of your code, where exactly does it break?
no we create the payment method else where and we used the saved paymentMethod id when creating the paymentIntent before confirming
in the code snippet i sent in a couple messages ago, we always get an error that looks like this
{
"stripeErrorCode": null,
"declineCode": null,
"localizedMessage": "Card details not complete",
"message": "Card details not complete",
"type": null,
"code": "Failed"
}
I have no idea what that means
you say you don't create a payment method but also say you do
Sorry to be pushy but I really need you to be crisp about what's happening
so we do create a payment method id but not in this flow. By the time we attempt to confirm a paymentIntent, we used a created paymentMethod id to create/confirm the paymentIntent, however every time we try to confirm the payment intent, we get the above error message
I'm so sorry this is still so unclear
Are you saying that you have a PaymentMethod pm_123 and you explicitly confirm the PaymentIntent pi_ABC with it, but then client-side for some reason you call confirmPayment() again? Because that will never work
but you just said the complete opposite earlier
By the time we attempt to confirm a paymentIntent, we used a created paymentMethod id to create/confirm the paymentIntent
you literally said this
sorry if that was confusing, let me elaborate, we create the intent and attach a paymentMethod to in our API. Once the client receives the secret in the response, we then calll confirmPayment and get the error
how come?
you're misunderstanding the whole flow and not following our doc I would say. That doc is here to show you have to have a UI to collect card details inline as you confirm. But your are not doing that, you already have a PaymentMethod pm_45678 and trying to use that and not the existing UI to collect card details. Right?
yea we initially wanted to use the Card component however our team wanted to style it differently which made us move in a different direction
in that case im guessing we have to confirm the paymentIntent on our backend instead?
when creating the intent?
paymentMethodType: 'Card',
paymentMethodData: {
paymentMethodId: 'pm_ABC',
billingDetails: {
phone: +${userDetails?.phone ?? ''},
},
},
});```
no
are you sure you put the right payment method id in there?
yup
ok i reboot the app and got a different error, i got a different error this time around but this one makes sense
{
"stripeErrorCode": "resource_missing",
"declineCode": null,
"localizedMessage": "There was an unexpected error -- try again in a few seconds",
"message": "No such payment_intent: 'pi_3Lf5b1DrfnMckC5C4pKntHdX'; a similar object exists in test mode, but a live mode key was used to make this request.",
"type": "invalid_request_error",
"code": "Failed"
}
looks like we arent using a test key in dev
is that correct?
yes
ahh yea one of our devs used the live key by mistakes, but this looks to solve our problem, thanks!