#jgcardelus_product-price-implementation

1 messages ยท Page 1 of 1 (latest)

twilit sedgeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1334580030109384799

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

lofty otter
#

Hi ๐Ÿ‘‹

There are no specific limitations on how many Products/Prices you can create. How you choose to implement this is up to you

#

It might make sense to use Products to group categories or types and then define different Price objects for more detailed breakdowns.

#

What factors cause the prices to vary?

#

Also, you only need Products & Prices if you plan to use Checkout or Billing (Invoice/Subscriptions)

golden oyster
#

Hi! Thanks for the quick reply. Prices depend on stay duration and size of the apartment + any possible damage

lofty otter
#

You can create a Payment Intent for whatever amount you want

#

You could also create Prices based on units (e.g. per square foot or per day) that vary the units for each individual charge

golden oyster
#

I hadn't looked at that. It makes more sense to have one Payment Intent per cleaning, right?

I also need to collect a security deposit from clients, could I create a Payment Intent with the security deposit, the cleaning fee and later return the security deposit?

lofty otter
#

Okay I worry we're mixing up use cases here. So let's step back.

How do you intend to collect payment data from your Customers?

golden oyster
#

Ok. My customers book an apartment for a duration of time. Based on the price of the booking we calculate the security deposit and based on the duration of the stay and the size of the house the cleaning fee. Before the customer enters the apartment, they pay both. After the customer has left the apartment, if no damages are found, we return the security deposit.

lofty otter
#

Sorry that's not what I meant. What Stripe product are you planning on using to collect payment from your customers?

golden oyster
#

My bad. I was planning to use checkout

lofty otter
#

Okay so you will need to use Products and Prices, since those are required for the line_items parameter

#

How you choose to implement them, again, is fundamentally up to you. But it would make sense to use different line_items for the different charges that are being added up in a single transaction

#

e.g.

  • $/square foot = $X
  • $/day = $Y
  • Security deposit = $Z
#

You can also refund only part of a payment by specifying an amount.

golden oyster
#

Ok great. Thank you so much for the help!

lofty otter
#

Sure thing! Happy to help ๐Ÿ™‚