#Kromolabs Developer-sepa-recurring
1 messages · Page 1 of 1 (latest)
pi_3KswYtEWpJyoCJo91MM2NxNu
this is the subscription sub_1KsZ6kEWpJyoCJo9hBG6d0AO
Yep, you've never actually confirmed the PI/SI that's returned from the subscription creation
That step is what creates the mandate: https://stripe.com/docs/payments/sepa-debit/accept-a-payment?platform=web#web-collect-payment-method-details
My flow is this:
1- customer already have a pm that is a sepa debit
2- I use this API (https://stripe.com/docs/api/subscriptions/create) to create the subscription, and retrieve the pi from the result
3- The first pi is confirmed via a click on a button that does confirmSepaDebitPayment on the pi retrivied on point 2
4- First payment succeed and subscription is created correctly
It seems that i have to run confirmSepaDebitPayment on each renewal but that's not correct, i guess
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hmm, indeed. I can see the initial PI was confirmed, sorry I misspoke
It seems that the system doesn't create a mandate for each renewal, and because of that every renewal fails
this is usually because something is wrong with the mandate, let me look into why the renewal PI failed(https://dashboard.stripe.com/test/events/evt_1KswYuEWpJyoCJo9pCdrQGJt) and get back to you
thanks a lot!
one example is that the mandate is invalidated if a previous payment was ever disputed but might be something else
Yes but it's test environment
With a sepa iban that should succeed istantly every payment
I think that if i manually trigger a confirmSepaDebitPayment on the pi of the renewal everything works
but it should be automatic
so yeah it fails because there's no mandate. I'm also noticing you use Connect so that's probably why
my guess is you collected the payment details on the platform and created the mandate there and then cloned to a connected account, which won't work, since the mandate lives on the platform but it's the connected account who needs to process the payment
confirming..
ok, not exactly what I said but ultimately you are not collecting a mandate
yes it works very differently for SEPA than for cards (to the point where I would use entirely different code for the branches)
https://stripe.com/docs/billing/subscriptions/sepa-debit you have to create a SetupIntent and confirm that, which creates the mandate , and then create the subscription
or just use Checkout and it does everything for you
and with that every further renewal will automatically gather the mandate?
unfortunately i can't use Checkout
the future payments don't have to gather a mandate as such, but yes they should work. The idea is when accepting the customer's IBAN, you also need to attest that they've accepted the debit mandate(which is done by passing API parameters with the timestamp/IP address, confirmSepaDebitSetup in stripe.js does that automatically). That attestation has to exist for us to be able to process any further payments, so as long as it's set up initially it should work for future payments.
So the first time a customer enters a sepa debit method i need to create a SetupIntent and then confirm it with confirmSepaDebitSetup. Or should i do the confirmSepaDebitSetup on each subscription the customer wants to apply?
AFAIK you only need to do it when they enter the payment method. good question though, I think it works fine for having multiple subscriptions on the same customer using the same payment method though I haven't explicitly tested that before