#birdy247

1 messages ยท Page 1 of 1 (latest)

split burrowBOT
prime stratus
#

We seem to be making far too many API calls and its taking 5/6 seconds to prepare things

#

1/ create customer

#

2/ create subscription schedule

#

3/ Finalise the invoice

#

4/ Update the payment intent for off_session usage

#

4 Api calls just to get the necessary payment intent secret

#

Can this be optimised?

#

Hello?

upbeat fulcrum
#

๐Ÿ‘‹ Hi there, Happy to help!

prime stratus
#

Can you see my messages above?

upbeat fulcrum
#

yes I'm on it

prime stratus
#

Thanks

upbeat fulcrum
#

Why are you doing step 3 and 4?

#

4 Api calls just to get the necessary payment intent secret
For example this step can be done at the same time while creating the subscritpion_schedule, by expanding the response latest_invoice.payment_intent, then you'll get the client secret directly

prime stratus
#

I tried that

#

But the invoice had a null payment_intent

#

because it wasnt fianlised

#

This is a subscription schedule

#

On subscriptions, we can pass 'payment_behavior' => 'default_incomplete',

#

But it seems different on subscription schedules]

upbeat fulcrum
#

You are right let me do some tests please

#

or you can keep your first logic, and do those steps asynchronously if your UX design allows that: like you don't collect all the information of the customer, the subscription, the plan in a single large form, but you do it in a seperate forms. Then after each step you do asynchronously one of the calls in order to not let the user waits at the ends 5/6 sec

prime stratus
#

Hi, sorry, just returning here

prime sparrow
#

@prime stratus Did you have a Q?

spring sluice
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!