#richard-xata-subscription

1 messages · Page 1 of 1 (latest)

eternal wing
#

👋 happy to help

eternal wing
#

I think you can, but I really need to test this

#

the idea is that you can pause the collection and the behavior could be set to keep_as_draft and set resumes_at to something like 5min after

#

in that time you could get the latest_invoice and update it

#

it will still be 2 steps but in that case you wouldn't have to generate a new invoice

agile cedar
#

Oh sorry should I have said. Tried that first of all.

latest_invoice.status == 'finalized' and it errored saying you cannot update a finalized invoice.

#

I also want to attempt to take the money synchronously so I can try and handle 3ds

#

I think a good goal might be: Do less API calls.

It's not ideal that I'm currently at 3. Can you create, finalize and pay and invoice in one?

dreamy gale
#

Can you create, finalize and pay and invoice in one?
Not currently, no

agile cedar
#

It says: You can’t, however, revise a void invoice or one that your customer has already paid

#

so maybe no good either? (but thank you!)

#

So given the constraint of: 'Synchronous for 3DS', the best we can do is 4 API calls?

Any advance on 4?

dreamy gale
#

What is the constraint? Sorry, haven't had opportunity to capture the full context of what you're trying to do

agile cedar
#

My understanding it's possible that when the upgrade happens 3DS might be triggered. Since the customer is present in my UI I'd like to synchronously check if they need to 3DS at the moment they upgrade their subscription.

dreamy gale
#

Yep, you'd check the status field on latest_invoice.payment_intent returned in the subscription update call

#

How do the description/metadata fields apply here?

agile cedar
#

How do the description/metadata fields apply here?
what do you mean sorry?

dreamy gale
#

Your original Q:

I'm want to update a subscription and charge our customer immediately. But I'd also like to control the description & metadata of the invoice.

agile cedar
#

yes that's right

#

what is your question? How do they apply? Apply to what?

#

You cannot pass invoice description / metadata on the subscription update call?

dreamy gale
#

No, you'd update them on the latest_invoice ID returned after the update call

agile cedar
#

but it would be finalized and possibly paid?

#

and you can't edit those?

dreamy gale
#

Correct

agile cedar
#

interesting

#

That possibly that would get us to 3 API calls.

I think I want allow_incomplete for my subscriptions really though

#

I mean...ideally it would be cool to be allowed to pass some invoice data when using proration_behavior: always_invoice

dreamy gale
#

Yep, fair!

agile cedar
#

I think maybe 4 api calls might be the way :\

#

I mean obviously with 4 calls I'm opening us to risk that if a middle call fails things will end up in a weird state.

dreamy gale
#

In those cases you'd chain them in that if 1 fails, the others aren't attempted

agile cedar
#

I mean

#

what if the last one fails?

#

now I've edited their subscription but not finailized the invoice?

dreamy gale
#

Most of them have a stripe.setMaxNetworkRetries(2) configurable param

agile cedar
#

ok thanks - I'll se it

#

Does the billing team have any plans to allow me to do it one?

primal mulch
#

Hi! I'm taking over this thread.

#

Can you clarify what you mean by "to allow me to do it one"?

agile cedar
#

@primal mulch have you read the thread?

primal mulch
#

Yes, are you asking about "create, finalize, and pay and invoice in one API call"?
If you want to suggest that as a feature request, you can contact Stripe support directly here: https://support.stripe.com/contact

agile cedar
#

If you read up a bit higher. It's actually on the subscription.update call

#

although consolidating invoices would be good too

#

It's 4 API requests back to back is the best solution so far

normal dagger
#

Unfortunately I'm not really sure whether this is on the roadmap currently but making a feature request here for your use case will definitely get us closer to that any which way.

agile cedar
#

Can I just link to here to explain or do I need to write out again?

normal dagger
#

I think writing a more concise summary of what you are aiming for would be better. You can link to this thread or copy the contents but that might be harder for us to turn in to an actionable request

agile cedar
#

ok I've emailed

#

Thanks for your suggestions.

normal dagger
#

Awesome! Thank you for your feedback