#harry_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/1222668323154825247
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Screenshots for context
#! /usr/bin/env python3.6
"""
server.py
Stripe Sample.
Python 3.6 or newer required.
"""
import os
from flask import Flask, jsonify, redirect, request
import stripe
This is your test secret API key.
stripe.api_key = {{test_key}}
app = Flask(name,
static_url_path='',
static_folder='public')
YOUR_DOMAIN = 'http://localhost:4242'
@app.route('/create-checkout-session', methods=['POST'])
def create_checkout_session():
try:
session = stripe.checkout.Session.create(
ui_mode = 'embedded',
line_items=[
{
# Provide the exact Price ID (for example, pr_1234) of the product you want to sell
'price': 'price_1Oyzy6FQKpzaQIrj4gOF3Fzr'
},
],
mode='subscription',
return_url=YOUR_DOMAIN + '/return.html?session_id={CHECKOUT_SESSION_ID}',
billing_address_collection='required'
)
except Exception as e:
return str(e)
return jsonify(clientSecret=session.client_secret)
@app.route('/session-status', methods=['GET'])
def session_status():
session = stripe.checkout.Session.retrieve(request.args.get('session_id'))
return jsonify(status=session.status, customer_email=session.customer_details.email)
if name == 'main':
app.run(port=4242)
Hi, we talk about how you can turn off link here: https://support.stripe.com/questions/how-to-turn-off-link. Can you reveiw this and confirm that you've turned off link on the correct settings page? There are couple of places to turn them off and Checkout has a separate settings page.
Yes can confirm I've turned it off already
Can you share the checkout session id where you're seeing this behavior?
where do I find that? this is in my local environment
You can share the request id that create the Session. Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_i95c0PUFn6DdsK
Hello! I'm taking over and catching up...
Can you confirm Link is turned off here? https://dashboard.stripe.com/test/settings/link
yes it's turned off for test mode
do i need to turn it off for prod as well even if the call is using the test key?
No, you should only need to turn it off in test mode.
Let me take a closer look, hang on...
For that Checkout Session Link shouldn't be showing up. Can you share a link to the page where you're embedding Checkout so I can try and reproduce on my end?
It's locally hosted
I can share the code snippet though
otherwise the code is just the embedded form quickstart for python: https://docs.stripe.com/checkout/embedded/quickstart
You may want to edit or delete that message; it contains your test secret key, and this is a public server.
I recommend you write in to Stripe support so they can investigate. There may be an issue with your account, or a bug with Link: https://support.stripe.com/contact/email
If I take out the secret key, can you help me troubleshoot?
Or is support still the way to go?
I can't help more unless you can link me to a page where I can see what you're seeing.
I want to confirm I can reproduce the issue, then I would want to investigate the underlying network requests, console messages, etc.
can i just simply provide you my code omitting the secret key?
otherwise i'm going to have to explain this to stripe support all over again
No, your code won't help. The thing that would help the most is having a live link where I can see the issue and debug it.
hmm what if I set up a live example in replit?
As long as I can load the page, see Checkout, and interact with it, that would work.
ok lemme see if i can spin something up
ok I have it up and running here: https://de0a3b25-3d3c-4da2-b516-915586de7ae2-00-1qjomtbluy2tr.janeway.replit.dev/checkout.html
here's the link to the replit: https://replit.com/join/jztmpaofcx-harryxue1
Looking...
Ah, okay, I was mistaken earlier. The specific Enable Link in Checkout setting is an account-level setting, it's not something you can set separately in test and live mode. Go here: https://dashboard-admin.stripe.com/settings/link and make sure you're in live mode, then turn the Enable Link in Checkout setting.
Most of the other Link settings are separate for test and live mode, but this one isn't. Sorry about that!
np. have a good one ๐