#julien

1 messages · Page 1 of 1 (latest)

sour ginkgo
#

hi, can you share a PaymentIntent pi_xxx that's in that state?

ionic jay
#

yes!

#

pi_3LI0E4C8pVNfXauy1d0k6ePW

#

so, the PaymentIntent is generated automatically from the subscription, but is stuck on requires_confirmation even though the charge is supposed to be automatic

sour ginkgo
#

well the problem with that one is that the SEPA Debit mandate is missing.

And technically the confirmation was automatic, we tried to confirm, it just failed so now things are not in an ideal state.

ionic jay
#

Where am I supposed tu upload the mandate? I thought you didn't take care of mandates

sour ginkgo
#

not sure what you mean, can you elaborate?

#

from what I can tell, and I could be wrong, it looks like for this customer you :

  • created a subscription schedule to schedule creation of a subscription
  • created a CheckoutSession for them for a one time payment
  • when that payment was done, you set the SEPA payment method used in that payment as an invoice default
  • payments on the subscription fail because that was just a one time payment so it didn't set up a mandate for any future recurring payments.

If you want that flow to work, then I think you need to be setting setup_future_usage on the CheckoutSession so that the payment method is set up in the correct way (https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-payment_method_options-sepa_debit-setup_future_usage); or use a SetupIntent(looks like you tried that as well but it was never completed)

ionic jay
#

I thought I read in your documentation that the acceptation was supposed to be on our end, not yours, that's what I am saying

#

Not exactly, What I did is :

  • Use a Checkout Session for a One Time Payment with a credit card
  • Use a SetupIntent & SubscriptionSchedule to setup a recurrent payment starting in 2 months time with an IBAN
#

but my SEPA debit doesnt go through the checkout session, but through my backend

sour ginkgo
#

not sure what you mean really. The way it works is the customer has to accept a direct debit mandate that you show them, and then you need to attest to use that it was done, by passing certain parameters in the API to indicate when they did that and their IP address etc. That's generally handled for you in our hosted surfaces but you need to tell the surfaces that you intend for future payments

sour ginkgo
#

I'm a bit confused, since this would never work and I assume you built all this in test mode first.

#

seems like you just created the PaymentMethod and saved it to the customer directly, which won't work for future recurring payments on SEPA Debit, a mandate is needed

ionic jay
#

ok, I need to dive into my code then

sour ginkgo
#

if you then follow the state machine with that SetupIntent it should result in a saved payment method with a valid mandate for future payments.

ionic jay
#

my idea was to add the iban on the user first through this setupintent, then save it as default, and then create the subscription_schedule on the customer

sour ginkgo
#

sure, works fine I think, but you need to provide mandate attestation.

#

just creating the PaymentMethod, saving it to the customer, creating a SetupIntent but never finishing it, does nothing but save an IBAN in our system, we can't charge that IBAN without attestation of mandate acceptance (which in this case would be provided by completing the SetupIntent , it's simply the https://stripe.com/docs/payments/sepa-debit/set-up-payment?platform=web flow)

ionic jay
#

okay, i didnt realize that the intent was not completed since the Iban was saved

sour ginkgo
#

no worries, a payment in test mode would have failed the same way though

ionic jay
#

Okay, I will check that out and get back to you if I have questions. Strangely I never came across Stripe Elements before, is it new?