#Kromolabs Developer-sepa-recurring

1 messages · Page 1 of 1 (latest)

outer tartan
#

Hey, do you have an example of a failing PI?

#

pi_xxx

covert sequoia
#

pi_3KswYtEWpJyoCJo91MM2NxNu

#

this is the subscription sub_1KsZ6kEWpJyoCJo9hBG6d0AO

outer tartan
#

Yep, you've never actually confirmed the PI/SI that's returned from the subscription creation

covert sequoia
#

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

outer tartan
#

Hmm, indeed. I can see the initial PI was confirmed, sorry I misspoke

covert sequoia
#

It seems that the system doesn't create a mandate for each renewal, and because of that every renewal fails

tardy shuttle
covert sequoia
#

thanks a lot!

tardy shuttle
#

one example is that the mandate is invalidated if a previous payment was ever disputed but might be something else

covert sequoia
#

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

tardy shuttle
#

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

covert sequoia
#

But with cards everything works normally

#

Is this relevant?

tardy shuttle
#

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)

#

or just use Checkout and it does everything for you

covert sequoia
#

and with that every further renewal will automatically gather the mandate?

#

unfortunately i can't use Checkout

tardy shuttle
#

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.

covert sequoia
#

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?

tardy shuttle
#

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