#angelica
1 messages · Page 1 of 1 (latest)
đź‘‹ happy to help
you can read through this doc https://stripe.com/docs/payments/accept-a-payment?platform=react-native
basically it's totally different from the web since we use PaymentSheet instead of PaymentElement
Thank you but i don't use the PaymentSheet
I've the card element to save cards and we save the sepa_debit through a simple form, sending to the the backend that save the paymentMethod
Then I just communicate at the backend the PaymentMethod id choosen by the user. The backend process the payment and come back to me with requiresConfirmation=true
Similar to the requiresAction of the cards
is there a reason why you're choosing to do it this way and not using PaymentSheet?
do you have the payment intent id that generated the error?
Yes, because we implemented Stripe on our app years before the react native library
I think at some point it's worth it to move to PaymentSheets, you wouldn't have to develop a new integration for any new Payment Method you choose to add at a later stage
we already have all the payments methods...
refactoring it's great, but it's not always possible.
could you please share it?
Yes, just one second
This is the backend answer, a great part it's coming directly from Stripe
paymentIntentStatus: "requires_payment_method"
requiresConfirmation: true
ok no Payment Method(PM) was attached to the PI at this point
this is why it's still in requires_payment_method state
So what it's missing it's a backend or frontend action?
were you able to create the sepa_debit PM?
yes, the PM was pm_1LvNO3FxDRRbzUUjJ8EFUAmB
then the problem might be attaching the PM to the PI but I wasn't able to find a request to do so
right now, we're trying to attatch the PM on the backend side (we were skipping this when the pm is a sepa_debit)
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
Thank you, as soon as we finish the test attaching the PM i will let you know if my problem is solved!
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
So: the reason becaouse we don't attach the PM to the PI is this error from Stripe:
“error”: “This PaymentIntent requires a mandate, but no existing mandate was found. Collect mandate acceptance from the customer and try again, providing acceptance data in the mandate_data parameter.“,
How are you creating your Payment Method objects?
Honestly I don't know, I'm a frontend developer, not backend. But the payment methods created works fine everywhere, also on the website, we just use the ConfirmSepaPayment and everithing works.
I'm just missing this extra action on the react native library
Use stripe.confirmSepaDebitPayment in the SEPA Direct Debit Payments with Payment Methods flow when the customer submits your payment form. When called, it will confirm the PaymentIntent with data you provide. Note that there are some additional requirements to this flow that are not covered in this reference. Refer to our integration guide for more details.
When you confirm a PaymentIntent, it needs to have an attached PaymentMethod. In addition to confirming the PaymentIntent, this method can automatically create and attach a new PaymentMethod for you. If you have already attached a PaymentMethod you can call this method without needing to provide any additional data. These use cases are detailed in the sections that follow.
This is from your docs: https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment
And this is exactly my case: I have to confirm and attach the PM
Can you share a pi_xxx ID where you're having issues?
It's up here
pi, pm, everything
and, anyway, this is valid for each PI_xxx we created for sepa_debit payments.
This one? pi_3M6sfPFxDRRbzUUj1HT6hWHy
yes
It's very simple.
React version has the confirm_sepa_debit_payment function that we use with the client_secret and the PM ID to confirm and attach the PM.
React native has only ConfirmPayment, a function that is not accepting the PM ID.
It's the way you create the PM: https://dashboard.stripe.com/test/logs/req_wCMGNsWUGM9MUh
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
We don't generate a mandate via the API, only when collecting and confirm a payment in the hosted UIs (like Elements)
Not React Native specific, but same principle applies
It can't
You use the UI components from our React Native library (which wraps the Mobile Payment Element) to collect the SEPA details from your customer, and then on confirmation we generate the required mandate and process the payment
Generally you should just stop creating Payment Method objects that way
"and then on confirmation we generate the required mandate and process the payment"
why this can't be applied to react native also?
not sure I follow what you mean, it can be applied. IF you use confirmPayment with the PaymentSheet component, it supports SEPA Debit payments and creates the mandate automatically, same as the web integration.
On the web we don't use the PaymentSheet
we create the PM as the app, and then we use the confirmSepaDebitPayment function.
and this works.
yep but that is considered a somewhat legacy flow and I don't think we support that in the RN library.
the default Stripe integration is that you create Intent objects on the backend, pass to the frontend, and confirm them there with our frontend component to complete the payment.
Really?
https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment
I can't see any hint on this being dismissed or legacy
yep I know it doesn't say that, the docs are not perfect unfortuantely and not everything is perfectly aligned internally. But it is true, the default integration is what I said.
Ok, I will patch the library myself. This is not a frontend api, so a porting from react to react native shouldn't be dificult.