#hamid-sepa-debit

1 messages ยท Page 1 of 1 (latest)

ionic fiber
#

Hi there ๐Ÿ‘‹ did you build mandate acknowledgement into your flow?

grand gorge
#

i showed that text on the page

#

this one

ionic fiber
#

Is your frontend built using Stripe Elements, or is this for a React Native project?

grand gorge
#

is angular project

#

separate team

#

is managing that, what are they missing?

#

there?

ionic fiber
#

Thank you for the clarification, do you have a request ID from where you saw the error returned?

grand gorge
#

let me see

#

i just have this error

ionic fiber
#

It's difficult to tell exactly what's happening from that alone, but it appears that the mandate information is not being provided to the PaymentIntent object. This should be done either when the PaymentIntent is created, if the intents are set to auto-confirm:
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-mandate_data
Or while confirming if you're using a manual confirmation process:
https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-mandate_data

grand gorge
#

these are my params on backend in ruby code

#
            customer: stripe_customer.id,
            payment_method: stripe_payment_method.id,
            off_session: true,
            confirm: true,
            amount: amount,
            currency: currency,
            description: description,
            metadata: metadata,
          }```
#

so it clearly shows confirm: true

dreamy timber
#

hey there, just catching up here

grand gorge
#

great

dreamy timber
grand gorge
#

do not have req_id

dreamy timber
#

Where are you seeing this error then?

grand gorge
#

in rails code

#

while creating payment intent

dreamy timber
#

that creates a Stripe API request, and should have a request ID

#

its in the response headers

grand gorge
#

actually it was on client's server, let me try to get id

dreamy timber
#

can you share any specific object id, like a payment method?

grand gorge
#

req_SN7Hc3kWHxVHn7

#

here you go

dreamy timber
#

ok thanks!

grand gorge
#

stripe_intent = Stripe::PaymentIntent.create(stripe_params)

#
            customer: stripe_customer.id,
            payment_method: stripe_payment_method.id,
            off_session: true,
            confirm: true,
            amount: amount,
            currency: currency,
            description: description,
            metadata: metadata,
          }```
#

coz the same code was working in locally then in test evn, everywhere, but no sure why its not working on current client's instance.

grand gorge
#

any update

dreamy timber
#

still looking, bear with me ๐Ÿ™‚

grand gorge
#

yea yea sure

dreamy timber
mystic sluice
#

My understanding is that after the SEPA Debit succeeds, you get the mandate id mandate_123 and then you store that in your database to use on future payments

grand gorge
#

nopes, thats not called madate id

#

its payment_method which we save and use in our code

#

for future payments

mystic sluice
#

there are both though

grand gorge
#

so i am still not clear, whats happening here

mystic sluice
#

Can you try what I just explained? The SetupIntent has a clear mandate id that you need to pass on PaymentIntent confirmation

grand gorge
#

but point here is it was working fine on all of our servers, we never used mandate_id

mystic sluice
#

Do you have a concrete example where it worked fine?

grand gorge
#

this is our complete process,

  1. we created setup intent from Backend
  2. Front end gets secret and key nad confirm it from stripe.
  3. FE sends us back the payment method
  4. BE save it and create payment_intent when we need it
#

we have created so so many test payments with this complete flow

#

and with same code

mystic sluice
#

Sure, can I get a concrete example though? That way I can compare what is happening between the 2 requests

grand gorge
#

I do not have it right now, but ill create and will share with you.

#

i created quickly same flow for sofort and used its future payment

#

methodology

#

which returns sepa_debit_payment_method and used it for charge with same code

#

and it worked

#

see request_id

#

i am sure it will work for sepa as well

mystic sluice
#

Sofort is different though

#

please try the exact same flow as the one which fails in Live mode

grand gorge
#

i know but it is using sepa_debit_payment_method

#

here you got

#

it worked like a charm

#

this is 100% same replica

mystic sluice
#

@grand gorge perfect, let me have a look

grand gorge
#

yhx

mystic sluice
#

okay asked a colleague and found the obvious thing I was missing

#

The problem here is due to on_behalf_of. You create a SetupIntent without on_behalf_of and then your PaymentIntent has on_behalf_of. That's just not compatible, the Mandate/permissions are per connected account so that's what is blocking you

grand gorge
#

so you mean on behalf of is impacting mandate?

mystic sluice
#

yes it does, you need a mandate per connected account in that case

grand gorge
#

hmmmm, let me see

#

i think there is some other problem, as per our code

#

we are either adding on_behalf_of in both cases or not

#

its not like in setup intent we are and in other we are not

#

can you provide which on_behalf_of we are using?

mystic sluice
grand gorge
#

hmm, let me see

mystic sluice
#

@grand gorge did that unblock you?

grand gorge
#

Thanks a lot for getting back and asking, I am waiting for the credentials from client

#

I might get it tomorrow

#

Can I resume this thread from here?

mystic sluice
#

the thread will be archived but you can ping in #dev-help with a summary and we can follow up! Overall it boils down to a misunderstanding with on_behalf_of so I think once you confirm that you should be unblocked!

grand gorge
#

Sure, thx again