#isaacs-Connect

1 messages ยท Page 1 of 1 (latest)

somber ermine
severe yew
#

hi, orakaro

#

Alternatively: (c) is there a way for us as the connected account owner to programmatically get the sk and pk for the connected account, so we can give them a handy code snippet to use in their app?

somber ermine
#

Hi, give me some mins to catch up

severe yew
#

take your time, I know connect issues get convoluted ๐Ÿ˜…

somber ermine
#

(a) Yes Platform should be creating the SetupIntent. SetupIntent can only be created server-side, via a Secret sk_ key
(b) It depends on which type of connected account. Standard: yes, express/custom: no.
(c) As mentioned in (b), if they are Standard they would have their key already.

#

Moreover, I would like to know your connected account type and your fund flow first.

severe yew
#

They are Standard accounts. Fund flow is still being worked out on the product side.

somber ermine
#

For Standard accounts I believe it's Direct Charge, correct?

#

So the ideal flow is:

severe yew
#

with standard accounts, the buyer is being charged by our user, correct. we can set an application fee, but we do not do the actual charging.

somber ermine
#

Yeah that sounds like Direct Charge above

severe yew
#

well, we're going to be doing a SetupIntent right? Not a PaymentIntent? Because it's subscription/metered charges.

#

not a one-off checkout

somber ermine
#

Yes, SetupIntent

severe yew
#

ok, cool, then I'm understanding you correctly, I think.

#

So we create the SetupIntent with our sk. โœจ somehow โœจ we send that seti_... key and our pk_... to our user, and have them use that to collect payment info from the customer using stripe elements. meanwhile, they send us API requests, and we figure out what the customer should be charged, and create the appropriate products/charges/subscriptions in their connected account, with appropriate application fee amounts so we get paid.

#

I think that means I have to implement an API that can refresh the setupintent, right?

somber ermine
#

First half of the flow LGTM. The second half about they send you API requests for you to figure out..., I think you can setup a Connect Webhook to listen to events from them. I don't have a handy example right now, but it worths trying

severe yew
#

yeah, that's not a stripe thing, that's our product ๐Ÿ˜…

somber ermine
severe yew
#

we are a metered billing product, make it easier for SaaS apps to iterate on their pricing, bill for metered usage with a nice API, etc.

somber ermine
#

Like you can listen to payment_intent.succeed from a direct charge mentioned here, I believe you can also listen to setup_intent.succeed from a direct charge

#

That would eliminate the need of your connected account calls your API

severe yew
#

they hit our api to say "user consumed X amount of Y". uploaded 100mb of files, consumed 30 minutes of hosting time, whatever.

#

we figure out how much to charge the customer, based on their configuration

#

and create the charges

#

but, of course, the end-user customer has to put payment info somewhere somehow

#

that's what i'm working out

somber ermine
#

Ah I see

#

Basically they report the usage on behalf of the customer

severe yew
#

right

somber ermine
#

Sure, that LGTM

severe yew
#

and then they get paid, we handle setting up the pricing page, make it all slick and easy, keep things organized so they don't shoot themselves in the foot, etc.

#

that's the pitch, anyway

#

is there any reason not to create a SetupIntent right away when creating a customer? It seems like we'll always need that

somber ermine
#

If you want to offer Subscription with trial, I think? Subscription with trail doesn't require Payment right away

severe yew
#

right, but the SetupIntent just gives you the seti id to use in the stripe elements payment info creation flow

#

or rather, the client_secret value

somber ermine
#

Yeah that's the standard flow. More concretely for a trial Subscription you have 2 choices:

  1. You can create a Subscription and take its pending_setup_intent, passing over to client, after client confirmed it you will have a trial Subscription that will automatically charge when its trial ends, using the confirmed info
  2. You can also create a Subscription with trial and start it right away, temporary ignore collecting Payment info. Later on when the trial ends, you can bring back your customer online, display an element, and confirm it with the PaymentIntent just generated with the Invoice
#

Anw 1 is recommended and you are doing it right, so feel free to ignore2. ๐Ÿ™‚

severe yew
#

ok, thanks. you've been really helpful.

#

I think I've got what I need until the next question arises ๐Ÿ˜„