#pkdiscgolf - checkout price

1 messages ยท Page 1 of 1 (latest)

quartz quarry
#

HI ๐Ÿ‘‹

#

In that case where you don't have a Stripe Price object with an ID, you will need to specify the price_data

worn wadi
#

so i need to add the "price_data" object to the line items object with a unit_amount?

quartz quarry
#

Yes, that will allow you to define the price amount without creating a Stripe price record

worn wadi
#

Thanks, i got it to work

#

It made me add "product data" in order to get it to work. Do you know why that is needed?

left drift
#

Snufkin had to step out but I do know why that is needed. When creating a line item, you need to pass in product info in one of two ways:

  1. Create a Product in beforehand and pass its ID (prod_123) in as the product field for your line item
  2. Provide info to create an ad-hoc product via product_data as you did just now
worn wadi
#

is this product data stored somewhere?

left drift
#

Yes, you can see it again by retrieving the Checkout Session that you created

#

Can you tell me a bit more about what you are trying to do here?

worn wadi
#

I am creating an event signup platform
Users need to choose between different levels of entry
Users need to also choose add ons
Then once price is figure out, i need to initiate payment, then add successful payment /entry/addons into databse

#

Im retired for the day though. Thanks for the help