#harry_unexpected

1 messages ยท Page 1 of 1 (latest)

white walrusBOT
#

๐Ÿ‘‹ 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.

molten ivy
#

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)

livid sirenBOT
weary valley
molten ivy
#

Yes can confirm I've turned it off already

weary valley
#

Can you share the checkout session id where you're seeing this behavior?

molten ivy
#

where do I find that? this is in my local environment

white walrusBOT
weary valley
molten ivy
#

req_i95c0PUFn6DdsK

fleet apex
#

Hello! I'm taking over and catching up...

molten ivy
#

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?

fleet apex
#

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?

molten ivy
#

It's locally hosted

#

I can share the code snippet though

fleet apex
#

You may want to edit or delete that message; it contains your test secret key, and this is a public server.

molten ivy
#

If I take out the secret key, can you help me troubleshoot?

#

Or is support still the way to go?

fleet apex
#

I can't help more unless you can link me to a page where I can see what you're seeing.

molten ivy
#

screenshot doesn't work?

#

what are you trying to see?

fleet apex
#

I want to confirm I can reproduce the issue, then I would want to investigate the underlying network requests, console messages, etc.

molten ivy
#

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

fleet apex
#

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.

molten ivy
#

hmm what if I set up a live example in replit?

fleet apex
#

As long as I can load the page, see Checkout, and interact with it, that would work.

molten ivy
#

ok lemme see if i can spin something up

fleet apex
#

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!

molten ivy
#

that fixed it

#

thanks for clarifying!

fleet apex
#

Happy to help!

#

Thanks for getting that up and running where I could debug!

molten ivy
#

np. have a good one ๐Ÿ™‚