#cyberbyte_api

1 messages ¡ Page 1 of 1 (latest)

drowsy solsticeBOT
#

👋 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/1220483739176534087

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

boreal rivetBOT
cedar bronze
#

Hi there! I'll need you to be way more detailed on what exactly isn't working. If you're following a guide, can you share a link to the guide here and specify where exactly you're running into an issue?

feral igloo
#

Hi there

#

This is what I'm trying to setup

#

Using html as front end

#

And php as backend

cedar bronze
#

Where are you blocked at the moment?

feral igloo
#

<br />
<b>Fatal error</b>: Uncaught Error sending request to Stripe: (Status 400) (Request req_2KpPaYuDbmtdJO) The price parameter should be the ID of a price object, rather than the literal numerical price. Please see https://stripe.com/docs/billing/prices-guide#create-prices for more information about how to set up price objects.
Stripe\Exception\InvalidRequestException: The price parameter should be the ID of a price object, rather than the literal numerical price. Please see https://stripe.com/docs/billing/prices-guide#create-prices for more information about how to set up price objects. in E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\Exception\ApiErrorException.php:38
Stack trace:
#0 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\Exception\InvalidRequestException.php(35): Stripe\Exception\ApiErrorException::factory()
#1 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\ApiRequestor.php(218): Stripe\Exception\InvalidRequestException::factory()
#2 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\ApiRequestor.php(180): Stripe\ApiRequestor::_specificAPIError()
#3 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\ApiRequestor.php(564): Stripe\ApiRequestor->handleErrorResponse()
#4 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\ApiRequestor.php(128): Stripe\ApiRequestor->_interpretResponse()
#5 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\BaseStripeClient.php(145): Stripe\ApiRequestor->request()
#6 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\Service\AbstractService.php(75): Stripe\BaseStripeClient->request()
#7 E:\Apache24\htdocs\skybyn\smietarot\assets\vendor\stripe\stripe-php\lib\Service\Checkout\SessionService.php(61): Stripe\Service\AbstractService->request()
#8 E:\Apache24\htdocs\skybyn\smietarot\kasse.php(20): Stripe\Service\Checkout\SessionServ

Model your business on Stripe with products and prices.

#

Oh okey, so you can't just enter the details in the api, you have to setup the product on stripe as well

cedar bronze
#

Thanks! In this case, the request ID (req_2KpPaYuDbmtdJO) is sufficient, no need to send the stack trace

#

The price parameter should be the ID of a price object, rather than the literal numerical price
This is an accurate description of what is happening here. The requst was for price: 299 but that's not how our API works. You either need to create a Price object first and pass its ID as the value of price (this is the recommended way), or you use line_items.price_data when creating the Checkout Session: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data