#angelica

1 messages · Page 1 of 1 (latest)

mental cloudBOT
icy rapids
#

đź‘‹ happy to help

#

basically it's totally different from the web since we use PaymentSheet instead of PaymentElement

sterile jay
#

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

icy rapids
#

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?

sterile jay
#

Yes, because we implemented Stripe on our app years before the react native library

icy rapids
sterile jay
#

we already have all the payments methods...

#

refactoring it's great, but it's not always possible.

icy rapids
sterile jay
#

Yes, just one second

#

This is the backend answer, a great part it's coming directly from Stripe

#

paymentIntentStatus: "requires_payment_method"

#

requiresConfirmation: true

icy rapids
#

could you please paste here the paymentIntent id?

#

pi_xxx

sterile jay
#

it's there: pi_3M6sfPFxDRRbzUUj1HT6hWHy

#

hope it's the right one

icy rapids
#

ok no Payment Method(PM) was attached to the PI at this point

#

this is why it's still in requires_payment_method state

sterile jay
#

So what it's missing it's a backend or frontend action?

icy rapids
#

were you able to create the sepa_debit PM?

sterile jay
#

yes, the PM was pm_1LvNO3FxDRRbzUUjJ8EFUAmB

icy rapids
#

then the problem might be attaching the PM to the PI but I wasn't able to find a request to do so

sterile jay
#

right now, we're trying to attatch the PM on the backend side (we were skipping this when the pm is a sepa_debit)

lean plover
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

sterile jay
#

Thank you, as soon as we finish the test attaching the PM i will let you know if my problem is solved!

errant igloo
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

sterile jay
#

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.“,

errant igloo
#

How are you creating your Payment Method objects?

sterile jay
#

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.

#

And this is exactly my case: I have to confirm and attach the PM

errant igloo
#

Can you share a pi_xxx ID where you're having issues?

sterile jay
#

It's up here

#

pi, pm, everything

#

and, anyway, this is valid for each PI_xxx we created for sepa_debit payments.

errant igloo
#

This one? pi_3M6sfPFxDRRbzUUj1HT6hWHy

sterile jay
#

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.

errant igloo
#

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

sterile jay
#

Ok. So how can the web function confirmSepaDebitPayment works?

#

(on the same PM)

errant igloo
#

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

sterile jay
#

"and then on confirmation we generate the required mandate and process the payment"

#

why this can't be applied to react native also?

gusty sun
#

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.

sterile jay
#

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.

gusty sun
#

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.

sterile jay
gusty sun
#

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.

sterile jay
#

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.