#Vince

1 messages · Page 1 of 1 (latest)

deft geyserBOT
mental trellis
#

Hi

pliant dock
#

Hello! What is the price you're expecting and what's the price you're seeing in Checkout?

mental trellis
#

i expect 15000 since its 5000 x 3 but I get 150.00 . Is it required to multiple the unit_amount in order to get the expected amount?

#

What I am doing is

         'price_data' => [
                    'currency' => 'usd',
                    'product_data' => [
                        'name' => $listing->name,
                    ],
                    'unit_amount' => $listing->cash_commission,
                    
                ],
                'quantity' => $listing->min_contracts ,
                ],

#

I dont know if i am doing the correct thing. I am new in stripe 🙂

pliant dock
#

The Stripe API uses the smallest currency unit, so you're dealing with cents in the API, not dollars, so what you're seeing is expected given an amount of 15000.

#

If you want it to be $15,000 you need to set it to have a total of 1500000.

mental trellis
#

hmm so i should multiply it? what is the best method to achieve it? should i do it like
'unit_amount' => $listing->cash_commission * 100 ?

#

hmmm

pliant dock
#

Yep.

mental trellis
#

i see. so everytime I put a price. it should always be multipled by 100?

pliant dock
#

If you're using dollars, yes, because the Stripe API is expecting cents.