#sindev_error
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
π This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1479059486365843548
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sindev_error, 5 days ago, 15 messages
- sindev_error, 6 days ago, 54 messages
π Do you have a screenshot of where this error shows?
this modal has the embedded payment method
for amazon pay for example the Amazon pay option is displayed
Are you passing 'link' to your paymentMethodTypes?
If so, I believe this is unnecessary. As you are creating your payment intent using automatic payment methods, the element should auatomatically surface Link when appropriate
I believe it's not an expected value in that param, so you should omit it there. The link config is actually specified in this param in the EmbeddedPaymentElementConfiguration: https://stripe.dev/stripe-react-native/api-reference/interfaces/EmbeddedPaymentElementConfiguration.html#link
I didn't get it, so config for link is not the same as amazon or satispay for example?
hey there π taking over as my colleague needs to step away
to clarify, you're currently manually listing payment method types, rather than relying on Stripe's automatic payment methods, correct?
can you share more about your flow? for example, at what point do you create the PaymentIntent
our recommended approach is to omit payment_method_types and rely on Stripe to automatically determine which payment methods to surface: https://docs.stripe.com/payments/mobile/accept-payment-embedded?platform=react-native&type=payment#enable-payment-methods
payment intent is created once entering the screen, 1 payment intent is used for all kind of stripe payment methods
I render custom UI (I verify that amazon_pay satispay and link are part of payment method types in the payment intent (BE returns this data for me)
since intent is created on the BE side
then when I click on 1 of the custom components, a popup with the embedded payment method is shown inside
for example, amazon pay
Link on the other hand shows only that error message
could you share an example of a PaymentIntent ID (pi_123) that you got this error with?
when I add all 3 paymentMethodTypes
amazon satispay and link
Link is shown correctly
['amazon_pay', 'satispay', 'link'] with this config Link is shown
['link'] with this, it shows the error
we'll need some concrete examples to investigate to properly understand the shape of your integration - is it possible for you to share an example PaymentIntent ID that the error happened with?
also if you could share the React Native code you use to integrate the embedded payment element, that would be helpful
const intentConfig =
hasStripeIntent && totalAmount > 0
? {
mode: {
amount: Math.round(totalAmount * 100),
currencyCode,
},
paymentMethodTypes: selectedStripeType
? [selectedStripeType]
: getStripeEmbeddedPaymentMethodTypes(),
confirmationTokenConfirmHandler: (
_confirmationToken: unknown,
intentCreationCallback: (
params: import('@stripe/stripe-react-native').IntentCreationCallbackParams
) => void
) => {
if (stripeIntent?.clientSecret) {
intentCreationCallback({ clientSecret: stripeIntent.clientSecret });
} else {
intentCreationCallback({
error: { message: i18n.t('payment.paymentNotReady'), code: 'Failed' },
} as import('@stripe/stripe-react-native').IntentCreationCallbackParams);
}
},
}
: null;
const elementConfig =
hasStripeIntent && totalAmount > 0
? {
merchantDisplayName: 'example.com',
returnURL: 'example://payment',
allowsDelayedPaymentMethods: true,
rowSelectionBehavior: {
type: 'immediateAction',
onSelectPaymentOption: () => {
if (
selectedStripeType &&
paymentOption?.paymentMethodType === selectedStripeType
) {
handleConfirm();
} else {
pendingConfirmAfterSelectionRef.current = true;
}
},
},
appearance: {
embeddedPaymentElement: {
row: {
style: RowStyle.FlatWithDisclosure,
},
},
},
}
: null;
these are config I pass on to the hook
pi_3T7aGGDMPmPwJSYh0bFW4oRb
this is the payment intent id
To confirm, you init the Element without the intent yes? The intent is created separately?
the intent is created before the element is shown on the screen
it's created automatically once entering the payment screen
Right, but you're not actually initialising the Elements instance with it. You're using the deferred flow
hence the mode parameters
If you have an intent before initialing the element then why not just use it instead of doing the deferred flow?
Right now, your logic follows this: https://docs.stripe.com/payments/mobile/accept-payment-embedded?platform=react-native&type=payment#collect-payment-details
Where you call useEmbeddedPaymentElement and pass mode parameters, etc. Right? But before you call that, your app has separately also created a Payment Intent in the backend, yes?
yes, correct
OK, cool. Checking something
but it's weird why link is not shown if I specify only link, if I attach some other payment method along with it, it works
just Link, doesn't
other payment methods are working fine so far
This screenshot is for this PI, correct? pi_3T7aGGDMPmPwJSYh0bFW4oRb
I have many requests now, let me create new one
Basically, we want to know how the paymentMethodTypes param is computed in each instance/screenshot you've shared. This part:
? [selectedStripeType]
: getStripeEmbeddedPaymentMethodTypes(),```
should I open modal with just link or all payment methods?
paymentMethodTypes is ['amazon_pay'], ['satispay'] or ['link']
getStripeEmbeddedPaymentMethodTypes() is the fallback with all three of them combined
pi_3T7aWpDMPmPwJSYh0PHRLtIj here is the latest intent
I think the intent is irrelevant here because of how you initiate the Element β you can only do it in deferred mode (e.g. without an intent) looking at the SDK ref: https://stripe.dev/stripe-react-native/api-reference/interfaces/EmbeddedPaymentElementConfiguration.html
Documentation for @stripe/stripe-react-native
I think we're going to need to take this to a support case and we can investigate this further. Right now it's not clear why it's unavailable in some scenarios
Hello @untold hemlock, we have sent you a direct message, please check it at https://discord.com/channels/@me/1479088331693490249
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
Got the email β we'll be in touch shortly via email