#shaun-checkout-subscription-addon

1 messages ยท Page 1 of 1 (latest)

white veldt
patent hollow
#

Brilliant ๐Ÿ˜„

white veldt
#

They are really two different prices

#

one is the recurring amount, the other one is an upfront cost

#

How would you model this if not as 2 separate Prices?

patent hollow
#

Ah so they're kinda represented as:

Product
    Price
      or
    Price
#

As opposed to both prices at once

#

Makes sense

white veldt
#

usually they are also 2 separate products

#

at least in the way we recommend building this, otherwise you have 2 line items with the same product name which will confuse people

patent hollow
#

So

My Product (upfront)
  Price $20.00
My Product (monthly)
  Price $2.99/m
white veldt
#

yep exactly

patent hollow
#

Is there no way to group them, in the checkout page

#

Like a smaller version of this, per "line item"

white veldt
#

no, and honestly I think you don't really want that since people want to understand why they pay so much upfront and you'll want to track this in the future as your business grows and you start looking at analytics

patent hollow
#

Okay! thanks for the helpful info.

#

While I have your attention I have one more small question

#

Let's say I want to create my products/prices programatically, how would you approach that?

white veldt
#

I'd start by asking why? :p

#

is this to do custom pricing? Is this to import your entire catalog?

patent hollow
#

Well I have my products in config, and the prices are loaded and handled by my backend. I'd like to just loop through my products/prices and just create them on your api at start.

#

Your response suggests you want me to use stripe as the master of records

white veldt
#

well what you described is a one-off import right?

#

you don't do this every time you start your app

patent hollow
#

I'll tell you what, let me give you something more concrete

#

So I have a list of domains I want to sell

Each has an upfront and a monthly cost.

I can add and remove domains from my config, as well as modify their prices.

I need:

  1. My backend to have the up to date prices
  2. My stripe to have the up to date prices
#

If Stripe is the main source of truth, I need to store that the price is for a domain, on stripe

#

If my app is the main source of truth, then I need to make sure I'm not creating duplicate stuff on stripe

#

Maybe something like this, then when my app starts, I retrieve all products and check the metadata?

#

(I'm just brainstorming)

white veldt
#

yeah don't do anything that requires "syncing when starting the app"

#

that's fine today, when you have 5000 products though that's 30s of start time you can't take back

#

My take is that Stripe should be the source of truth and a record of your internal prices. And whenever you add/remove product/prices you sync those changes to Stripe (Product inactive, old Price replaced by a separate Price with a new amount, etc.) and you map those in your database

patent hollow
#

Stripe source of truth -> Application (caching in database) -> Front end?

#

something like that?

white veldt
#

I think so. You threw the front end in now and that's a bit different but I assume it's because you display all your prices client-side and let someone choose what they want right?

patent hollow
#

Exactly

white veldt
#

then yeah I'd basically have 2 things. One is my own database of all my "prices" and the corresponding Price id (and Product id) in Stripe. That's what I use to render this client-side with all the info and choose the right Price id price_123 based on the user's choice
Separately I'd have a script/logic that can handle "price changes" on my business to update records in Stripe and my database if that makes sense

patent hollow
#

Yes we're on the same page

#

Now if it goes wrong I can blame Stripe and not myself

#

(jokes ๐Ÿ˜‚)

#

Thanks a lot, I'm sure I'll be back at some point ๐Ÿ˜‰

white veldt
#

please do!

#

Going to archive the thread but you can ask again in #dev-help if you have follow ups (like you rightfully did and I said nonsense ๐Ÿ˜น )