#Naveed | Web3Auth

1 messages · Page 1 of 1 (latest)

mighty garnetBOT
sullen abyss
#

Hi there, yes the first 0 dollar invoice will be paid regardless whether there's a card on file.

#

Can you explain your use case? why do you need to create a incomplete subscription with $0 price line items?

pallid torrent
#

So basically I previously supported flat fee subsriptions that required up front payment say 60USD, so I would create an incomplete sub and sent the intent to the frontend to confirm payment

Then i would listen to customer.subscription.updated to provision access to my service.

However, now I need to support a new type of subscription that has no flat fee, but i still wanted users to add their card during the flow. Besides I also noticed that in this flow only customer.subscription.created event is fired

#

so I was not able to provision access to my service using my existing implementation

sullen abyss
#

subscription that has no flat fee -> what kind of subscription it is?

pallid torrent
#

metered

#

starts at $0 for first 1000

#

then above that has some fee

#

say 0.03usd per unit

#

the flat fee subs basically were a hybrid, they had a flat up front AND metered

sullen abyss
#

OK. Metered prcing is post-paid (meaning your customer is invoiced at the end of the billing cycle), but per-seat pricing is pre-paid. So they are different in terms of when your customer is billed.

#

So when do you wish to provision access to your service in the post-paid scenario?

pallid torrent
#

Hmmm... I think in all cases immediately

#

i wonder if i should use two different subscriptions to model this sort of scenario tbh

#

its not deciding between per seat and metered

#

my plans are basically
Base - only metered
Growth - monthly 60USD + metered rate
etc.

#

but i think in all cases Id provision service immediately

#

idk if the invoice would look strange though for hybrid

sullen abyss
#

Stripe will handle this for you.

In this case, your customer will still be invoiced at the beginning of billing cycle, and the metered usage will be included in the next invoice.

pallid torrent
#

yes I see, after running the test clock simulation i see this

#

As for the first invoice I see this

#

the intervals show up the same in the beginning, but subsequently its what we expect

sullen abyss
#

OK, the per mau invoice line item is $0 right?

pallid torrent
#

First invoice

#

Second invoice

#

Maybe then I should listen for both subscription.create and subscription.updated?

#

if status is active provision service?

sullen abyss
#

I'd suggest listening to subscription.updated and check if the subscription is active

pallid torrent
#

i think in the case where sub is created immediately no updated event is fired

#
2023-02-23 12:41:53   --> setup_intent.created [evt_1MeWcvImFOsfVEtUj5PkhQUz]
2023-02-23 12:41:53  <--  [200] POST http://localhost:5051/billing/webhook [evt_1MeWcvImFOsfVEtUj5PkhQUz]
2023-02-23 12:41:54   --> invoice.created [evt_1MeWcvImFOsfVEtUW4t06u7Z]
2023-02-23 12:41:54  <--  [200] POST http://localhost:5051/billing/webhook [evt_1MeWcvImFOsfVEtUW4t06u7Z]
2023-02-23 12:41:54   --> invoice.finalized [evt_1MeWcvImFOsfVEtU9oKygz2r]
2023-02-23 12:41:54  <--  [200] POST http://localhost:5051/billing/webhook [evt_1MeWcvImFOsfVEtU9oKygz2r]
2023-02-23 12:41:54   --> invoice.paid [evt_1MeWcvImFOsfVEtURCSok3Jt]
2023-02-23 12:41:54  <--  [200] POST http://localhost:5051/billing/webhook [evt_1MeWcvImFOsfVEtURCSok3Jt]
2023-02-23 12:41:54   --> invoice.payment_succeeded [evt_1MeWcwImFOsfVEtU7vJOs6A3]
2023-02-23 12:41:54   --> customer.subscription.created [evt_1MeWcwImFOsfVEtU5SPqswhx]
2023-02-23 12:41:54  <--  [200] POST http://localhost:5051/billing/webhook [evt_1MeWcwImFOsfVEtU5SPqswhx]
2023-02-23 12:41:54  <--  [200] POST http://localhost:5051/billing/webhook [evt_1MeWcwImFOsfVEtU7vJOs6A3]

#

ok just confirmed

#

setup_intent.created
invoice.created
invoice.finalized
invoice.paid
invoice.payment_succeeded
customer.subscription.created