#nerder

1 messages ยท Page 1 of 1 (latest)

errant impBOT
verbal igloo
#

Hello ๐Ÿ‘‹
How can I help?

fleet folio
#

Hey @verbal igloo, i'll try to explain a bit what i'm trying to accomplish here

#

the use case is to be able to manage 2 types of gym subscriptions:

  1. Recurring payments
  2. One-off payments (drop-in)

I already implemented recurring payments using subscriptions and all is fine, now i'm attempting to support drop-ins also. The path i chose so far is to use normal invoice to charge the customer when they try to buy a drop in.

#

Now I need to handle a webhook event back when the customer has paid so that the app can present the correct UI for the drop-in active.

#

But i wonder that simply listening for invoice.create event will return all the invoices created (also the ones from the subscriptions i guess)

#

and now i have a doubt, should I manage this as a "subscription" with no billing cycle instead?

#

not sure if this is possible

verbal igloo
#

can you expand a little bit more on how one-off payments (drop-in) "subscription" works? I'm a little confused by a one-off payment being linked to a subscription ๐Ÿ˜…

fleet folio
#

hehe i'm a bit confused too

#

ok in my head drop-ins are just a special "gym subscription", in a sense they have a price they have an amount of sessions to be used (from 1 to n)

#

so my initial idea was, ok i simply let the customer pay the invoice that i generate when they try to buy a product and than when the webhook that the payment is sucessfull i present the correct UI

#

but then another idea came, since they are a special "subcription" then i should handle them as a subscription, and from the client handle the cancellation of such membership when the customer has no more sessions

#

but in order to do this i need to create a subscription that has no "next invoice"

#

and that can be cancelled from the UI

#

So i'm not sure which approach is best here, as both seem like a hack to me.

  1. Create a "fake" subscription that doesn't ever renew and gets cancelled when the user completes the available sessions (my client will keep track of that)
  2. Create a one-off invoice for the specific product, handle the invoice.paid event correctly, and do everything manually in the client
verbal igloo
#

hmm okay, let me think

#

I think option 2 would be a better choice here as you'd be able to do whatever you want with it versus using a "fake" subscription (with let's say a trial so that there's no next invoice)

fleet folio
#

yes, seems more natural with option 2

#

but it was very convenient the option one because basically i could have reused all the code almost

#

another thing i lose here might be that for instance i can't see from stripe all the customer that have "10 drop-ins" membership still active

#

because this is an invoice not a sub

verbal igloo
#

Yeah that true

#

You may need to play around with trials and metadata to achieve what you want with the API but It would be much easier with just building your own solution for this ๐Ÿ™‚

fleet folio
#

thank you so much for let me rubber duck this with you

#

you was of great help

#

have a good day!

verbal igloo
#

NP! ๐Ÿ™‚ Happy to help
Good luck