#peos-sub-pm-connect
1 messages ยท Page 1 of 1 (latest)
Hi there! Bare with me sorry ๐ So we have a Saas platform that uses Connect, we offer both one-off payments and subscriptions. We started receiving a large amount of errors in the last week around subscriptions setup - after diagnosing the issue with the help of one of your colleagues we found the issue to be that we were initialising Stripe JS without the Connect StripeAccountId - that seemed like a pretty straightforward fix because I was sure we already did it but it seemed we only initialised it that way for one-off payments. For subscriptions we're instantiating the platform Stripe account on Stripe JS - then we capture the card details with Elements creating a PaymentMethod, POST to our server and attach it to the Platform customer and then create an instance of that Customer on the Connect account with the same card and pass the results back to the client to handle any SCA related challenges. What we've realised is that when challenged like this, our instantiated version of Stripe JS is the Platform account, so when we try to confirm we're sending it to the wrong account. I've tried a test of switching the StripeJS instantiation out but it doesn't allow you to use a different instantiated version (for obvious reasons I know) is there anything we can do to get it to work do you know? Thanks
For context we add it to the Platform so a user can use their card on multiple of our clients and they don't have to keep creating "new" versions of the card for each Connect account
Hi there. Taking over for hanzo
Give me a bit to catch up. Sorry for the delay
Hm ok this is interesting. So are you using SetupIntents? If so, where? Both on the platform and Connect account, or just on the Connect account?
Yeah we're using setup intents through subscriptions - after we create it on the server and pass it back to the client we access the setup intent through the subscription - the subscription is set up on the connect account
We don't manually create a setup intents anywhere, its just a byproduct of the subscription
Got it but that SetupIntent is what you're using to do 3DS auth?
Yes
And because the Payment Method was created using an instantiation of Stripe pointing at our Platform, we then get a 404 error as it tries to confirm the Connect generated setup intent on the platform
Ah yeah. This is a tough scenario. You will probably need a refresh/redirect to re-instantiate with the connect account
Okay that could work - we're not adverse to changing the code either if there is a better way to do it - I looked through Stripe's docs and couldn't see something that looked like what we're doing with creating the PaymentMethod on the client - like would we circumvent this issue completely creating the PM on the server?
The issue is it sounds like you need to clone payment methods across multiple merchants that are connected to your platform
I think you are actually doing it the most efficient way
Would you potentially need to clone the payment method in the future? (ie. not immediately after the payment method is added) to different account(s)
Yeah if we have someone's card saved on our platform we'd like them to be able to use it for a new connect account in the future. Would it be possible if we maybe instantiated Stripe JS on the connect account and created the PM and Subscription there, and then tried to clone the PM into the Platform account at that stage, after the 3DS event?
Hm let me check with a colleague. I don't think this is possible but want to confirm
Are you using standard accounts?
Thanks very much - yeah they are all standard accounts
Okay fair enough - so do you guys have any docs or stripe-samples for that idea of creating payment methods that can sit at the platform level and then using that in connect accounts? Or should we just give up on saving the cards in the platform?
No I think your current flow will work. This is really the only sample we have for cloning PMs (I believe) https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
I think you'll just have to go the redirect/refresh route
To re-initialize elements with the connect account
Yeah I came across that doc - okay I think you might be right ๐ฌ I'll take a look - thanks for all your help!