#todd_unexpected

1 messages · Page 1 of 1 (latest)

open tokenBOT
#

👋 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.

slim geyser
#

Hello

#

I'm going to need more details to help.

#

What error are you seeing exactly?

plush pulsar
#

The embedded form returned says ' something went wrong please try again or contact the merchant'… There are no 'errors'.

slim geyser
#

Are you working with a third party here?

plush pulsar
#

No.

slim geyser
#

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?

plush pulsar
#

Yes. There are no cliént side errors.

slim geyser
#

Can you show me your relevant server-side and client-side code?

plush pulsar
#

It is the embedded form example verbatim from the API documentation

slim geyser
#

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

plush pulsar
#

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

slim geyser
plush pulsar
#

The keys from the API docs

#

Literally

slim geyser
#

Okay yeah that won't work. You need to create a test account and then use those keys

plush pulsar
#

Use test mode keys?

slim geyser
#

Do you have a Stripe account that you can log into and go to the Dashboard?

plush pulsar
#

Yes

slim geyser
plush pulsar
#

No. I will use those.

slim geyser
#

Okay yeah let's try that first