Creating a Metered Membership Fee that Charges Quarterly

Hi everyone, I could use a little guidance on how to setup a slightly unconventional membership fee structure.

The app I’m building has a kind of virtual currency that members utilize, and I want to create a recurring quarterly membership fee that is tethered to their total balance amounts, almost like an interest or demurrage.

So for instance, if a user has +/- 1000 virtual points, they are charged 0.5% each quarter = $5
I’d like the charge to happen on the same date for the entire community, if possible. So for example, April 1, July 1, October 1, January 1, at 12:00 am.

I’m utilizing @copilot’s Stripe.js plugin, btw.

My question is, do I setup a workflow in bubble to trigger these charges at these dates each quarter multiplying their balance by .005 ? I’m not quite sure how to trigger a workflow at a certain time like this. Here’s how I initially set it up. But it didn’t run last night when I originally had it set to 2/1/19. I know I’m goofing somewhere. Any help would be appreciated.

Or is there an easier way to do this via Stripe’s backend? I see that there is an opportunity in Stripe to create a recurring metered subscription plan, and select a charge date from the date the user signed up. Say a user signed up January 15, I could elect to charge users three months from their signup date (for this user: April 15), but that doesn’t solve my issue of wanting to get all users charged at once.

1.) I’m not quite sure how to set a custom date to charge all users of the subscription plan. Does anyone know how to do this?
2.) I’m not quite sure how Stripe would retrieve the metered units (virtual points balance) from bubble to do the calculation for the charge. Would this be setup in Stripe somehow or would I have to push the metered unit data from bubble to Stripe immediately prior to the subscriptions charging? Has anyone had experience in having bubble and Stripe communicate regarding charging metered units that can guide me?

Hope that all makes sense.

Hey @marktuff,

Based on the platform-wide events you require, there’s not a very strong argument for using Stripe’s Billing product. Just like Subscriptions, Charges are also not guaranteed collectible for reasons including insufficient funds, institution blocks, fraudulence and more. Instead of working up a subscription scheme, try a simpler implementation of a demurrage-esque system with API Workflows and Charges:

  1. Onboard user
  2. Create customer
  3. Tokenize and store card
  4. Allow virtual currency purchase
  5. Schedule parent/master API Workflow for target dates
  6. Schedule child API Workflow with user context
  7. Charge user based on balance
  8. Notify user of transaction
  9. Adjust account as needed

With subscriptions, you get the benefit of recurring charges with structured products and invoices which all rely on Charges to make things happen. It might not always make sense to set up an entire subscription model when all you require is charges to happen in a certain period. Though not a concern for most at first, it’s important to note Stripe Billing is not free with fees up to 0.7% of all recurring charges.

For both Subscriptions and Charges, you easily setup the Stripe webhooks you’d like as well. :slight_smile:

2 Likes

Hi @copilot thanks for the reply.

Just for clarity’s sake, in my app users cannot purchase the credit, they have to earn it. So slight but important difference there. In the end I’m sort of playing the same game as Stripe in taking a cut of “virtual currency transactions” too (in addition to the quarterly charge). I don’t mind Stripes fee on me there, as this is an MVP, and a means to an end. To slightly curb Stripes charge, I have set a rule to only charge when $10 worth of usage is reached or more on the transaction side. This still leaves me vulnerable to the scenarios you mentioned, but it’s the chance I’m willing to take as they won’t be able to do much in the app should the card not work.

I appreciate your outline here! I suppose I need to know how to do 5 onward, specifically 5 and 6, as I’ve never done those before and it’s a bit Greek to me. So if I’m understanding properly, your saying forget setting up Stripes subscription / plan products, and run things directly as a scheduled charge via Bubble? That’s where I’m hoping for some help and guidance. Can you (or any other forum users) help me (or point me in the right direction)?

I appreciate your links too. I actually took your course some time ago on payment platforms and it got me started, so thank you for that. I recall suggesting you do the virtual currency course too and I see that’s up there now (nice work!) but the preview video wasn’t loading for me, just fyi.

Appreciate the kind words!

Regardless of how you’re doing things within your application, your expected behavior is to charge users for some reason. With the model you’re going for, working everything Subscriptions may just prove to be more challenging and more tedious to maintain than simply scheduling platform-wide charges. :wink:

1 Like

No problem, and agreed.

Now what is the best way to go about scheduling platformwide charges at the quarterly times I’m looking at?

Whenever you see yourself needing actions to execute at set times, you’ll be looking at API Workflows. :+1:

1 Like

Thanks @copilot, this is one of the unchartered territories for me in bubble - API workflows, but I’m reading through the documentation and starting to get it. Thanks for redirecting me to those resources.

One major question I have now is on scheduling the workflow to run on a particular date, unrelated to current date / time, or the date / time a button (that triggers the workflow) was pushed. Is this possible, or is the frequency of running the API workflow always tethered to current date / time?

So for instance, if i wanted to bill all of my users quarterly as mentioned on April 1, July 1, Oct 1, and Jan 1, how do I go about setting up that start date?

I tried to put “Today’s Date / Time formatted as 2/02/19 is 4/01/19”… but that doesn’t seem to be right or work. I haven’t yet found a resource that addresses a custom date / time? Is this something bubble is not capable of doing? Perhaps I’m missing something obvious here. Staring-at-the-problem-too-long syndrome.

Take advantage of Bubble’s date operations by viewing the more options on a date, such as Current date/time. You’ll be able to add and change parts of the time to get your desired date. :wink:

Hi @copilot, that might be true that you can set a desired workflow date from the date of a particular trigger action, for instance when someone signs up.

However, how do you do a system-wide workflow that affects all users, like billing all users at once on the same day each quarter, when each of those users signed up at different times? Is that possible within bubble? Or possible aside from a particular trigger action?

From what I’ve seen it doesn’t appear to be possible. Am I wrong?

This topic was automatically closed after 70 days. New replies are no longer allowed.