#eugene-donations

1 messages · Page 1 of 1 (latest)

tired prism
#

hi! It depends a little how exactly you'll be integrating(using Checkout, or PaymentIntents directly)

thin basin
#

Easiest way is to use Checkout?

tired prism
#

it is yes!

#

if you want the amount to be flexible then you could ask the customer before redirecting to Checkout what amount they want to pay, and then pass the appropriate Price object in your code to the CheckoutSession.

thin basin
#

in
\Stripe\Checkout\Session::create() ?

now it is like this with fixed price
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => 'price_1KaIlnAUfA2l2EsjO9zOPjx9',
'quantity' => 1,
]],

Do i need to create list of prices for it?
Or I can use somehow amount itself?

tired prism
#

yep, so there's two options

#

you could create a set of Price objects in advance, and then based on what the user picks on the frontend, pass the appropriate price_xxx to that call

thin basin
#

Oh I see, thanks!