#todd_unexpected
1 messages · Page 1 of 1 (latest)
👋 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/1263583578772602923
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
The embedded form returned says ' something went wrong please try again or contact the merchant'… There are no 'errors'.
Are you working with a third party here?
No.
Okay this looks to be on a mobile device, have you hooked up anything so you can see client-side console/logs?
Or can you test on non-mobile so you can see any error in your dev console?
Yes. There are no cliént side errors.
Can you show me your relevant server-side and client-side code?
It is the embedded form example verbatim from the API documentation
Have you double checked to ensure you are using matching API keys (meaning the secret and publishable from the same account)?
Overall if you aren't willing to share information then I can't help you debug
Server side:
<?php
require_once '../vendor/autoload.php';
$stripeSecretKey='sk_test_51PUfn6Rv7zgTghoB6fMRxhcpEwftqSJHT7nB9Za2YpVzFmCd5haDX2a7sGkR10p9XfDNfNpieagNYH5702Nzx5Yj00U9nq7TPL';
$stripe = new \Stripe\StripeClient($stripeSecretKey);
header('Content-Type: application/json');
$YOUR_DOMAIN = 'http://localhost';
$checkout_session = $stripe->checkout->sessions->create([
'ui_mode' => 'embedded',
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => 'price_1PdOhfRv7zgTghoBLxlqgYhK',
'quantity' => 1,
]],
'mode' => 'payment',
'return_url' => $YOUR_DOMAIN . '/return.html?session_id={CHECKOUT_SESSION_ID}',
'automatic_tax' => [
'enabled' => true,
],
]);
echo json_encode(array('clientSecret' => $checkout_session->client_secret));
?>
I am using the test keys from the API documentation
What does that mean? The keys literally within the docs? Or keys from your own test account?
Okay yeah that won't work. You need to create a test account and then use those keys
Use test mode keys?
Do you have a Stripe account that you can log into and go to the Dashboard?
Yes
Okay and the keys you are using are from https://dashboard.stripe.com/test/apikeys ?
No. I will use those.
Okay yeah let's try that first