#Iwebu
1 messages ยท Page 1 of 1 (latest)
Hi there, I'm happy to help but I only speak English. Can you rephrase your question in English?
Some customers fall on an error page while others do not! I can not reproduce this error myself.
Can you past the error message on this chat? The image is small and I can't read the text
can you read now ?
I can not reproduce this error on my side but some customers yes
OK, can you paste the request ID (i.e., req_xxx) here?
where can i find this ID ?
It's in the screenshot that you pasted earlier, can you do a ctrl +F and search req_, copy the full request ID and share it here?
req_KOnXkNdWEa3Csd
Thanks. You can find the error in your log here https://dashboard.stripe.com/logs/req_KOnXkNdWEa3Csd . The root cause is that the unit_amount or unit_amount_decimal parameter is not set in the price_data hash
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
ok, so how can i fix it ?
Pass a unit_amount or unit_amount_decimal to price_data when creating a checkout session
you can see the unit_amout here ...
why it is not a problem for every order ?
can i use $_GET method ?
There's a possibility that $_SESSION['montant_cmd'] return empty data
or $_POST ...
Also I don't suggest you to get the amount from $_SESSION, $_POST or $_GET. If I were a bad customer, I'd just manipulate the amount
so how can i get the amout ? What do you suggest ?
Instead of creating an ad-hoc price in every checkout session. I'd suggest you to create the price upfront, and specify the price ID when creating a checkout session https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is it possible in PHP ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sorry but i don't see where price ID is create
https://stripe.com/docs/api/prices/create?lang=php#create_price This is the API to create a price. You can also create a price for Dashbaord
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There are several products in my cart, so I have to create a price per product?!
And the creation of this price must be done on the checkout page before passing the info to Stripe?
It's the same as what you do before through the price_data. The difference here is that the price you created through Prices API can be reused.