ruby on rails - When to process overages on a stripe subscription + quota -


i have rails app stripe handling subscription payments. subscription gives quota of messages send , if go over, want charge overage fee each message on quota.

how should go doing this? how can setup stripe invoice (used overages) right before monthly subscription fee gets charged? know how right after subscription fee gets charged (by listening webhooks successful charge) doesn't seem right way of doing it.

webhooks still right answer; you'd want invoice.created event. fires when invoice created, , stripe waits charge invoice until hour after webhooks have succeeded (or until 3 days have passed, whichever's first).

you can bill each individual message (creating invoiceitem) happens if makes more sense use case. they'll rolled next invoice automatically.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -