All threads / How to Set Up a Stripe Scheduled Subscription with an option for Deposit but with only X months to Pay the Balance?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to Set Up a Stripe Scheduled Subscription with an option for Deposit but with only X months to Pay the Balance?

Jim Miller asked in Rails

I am creating a Stripe product that gives the buyer an option to put a deposit down then they are given x amount of months to pay. Or they can pay in full. I'm sure that I would use scheduled subscriptions to do that. How would I set up that Subscription so that the customer only has x months to pay and requires the balance paid at the end?

Thanks!

Jim

What happens if they don't pay the balance? Do you just remove their access or something?

If these are subscriptions, Stripe Invoices have a "days_until_due" option. https://stripe.com/docs/api/invoices/create#create_invoice-days_until_due

If they're not subscriptions, I would just create a record to keep track of the order and the due date. If the current date is past the due_date, then you know it has elapsed.

You can then use a cron job to email the user warnings if it's 7 days till deadline, etc.

Its for a Tattoo Convention. These are artists putting a deposit down for a booth or multiple booths. The deposit is "no refund". Which is the industry accepted practice.

The system I am creating will:

  • have the artist register with the normal contact info plus other info like tattoing style, Instagram and/or Facebook urls and their picture which will be in their profile/account info in Devise.
  • Then they can pay full price for a booth(s) or they can put a deposit down.
  • The deposit holds a booth for them until the determined due date. If the date passes, they loose the spot for the booth and deposit.
  • Once the artist pays in full, their info and picture will be posted on the site, not before. This is for advertisement on the Convention site so its incentive for them to pay in full so they get there advertisement on the site. So I need to record when they complete payment so then I will have the advertisment posted dynamically to the Convention site, which is a Wordpress site.

I also found that you can set the Stripe API to send the invoice to the customer by email, which is cool:
https://stripe.com/docs/billing/invoices/sending#dunning

Very cool!

Since these aren't subscriptions, I don't believe you will be able to use Stripe Invoices or any of those features. Those I believe only work for subscriptions, so I guess that you will want something like this instead:

  • Reservation model with the due date.
  • One (or more) Payments related to the Reservation. This way you can keep track of the deposit and the final payment related to it.
  • Create the reservation after the payment is successful.
  • Email them reminders in a cron job about their upcoming due date and remaining balance (if any).

That's probably what I would do. Nothing too fancy.

Its only "Very cool" if it works! LOL

So you are basically saying that I control everything in Rails and just use Stripe as the final payment method, right?

So like this:

  1. The deposit would be one payment thru Stripe, say $200 out of $400 (I'm assuming that I can use the same JavaScript as I have been with your tutorial?)
  2. Thru Rails I would set that as "deposit". Maybe using Enums? enum status: [:paid_in_full, :deposit]
  3. Set up Cron to send an email to all depositors every month as a reminder
  4. The rest of the payment would be a seperate payment thru Stripe
  5. If full payment is made, update status: :paid_in_full
  6. If status: :paid_in_full, then show advertisement on WordPress site

I plan on pulling json generated from the users controller to populate the WordPress site. I'm sure I will post questions when I get to that stage!

Thanks for the help, Chris!

I t hink that sounds right to me!

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,399+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.