Forums data and opening a webpage through python(kivy)

Hi there, What I am trying to achieve is that when I click a button on Kivy, it would the "email" data to Flask, and Flask will use this email data to create a checkout session which will open a webpage (web.html). It seems now I able to get this email data, but a new web page wont open in a browser. How do I achieve my goal. Or am I in the wrong direction?. Thanks in advance.

def payment():
    global email
    req_data = request.get_json(force=True)
    session = stripe.checkout.Session.create(
        'name': 'T-shirt',
        'description': 'Comfortable cotton t-shirt',
        'images': [''],
       'amount': 1000,
        'currency': 'myr',
        'quantity': 1,
      billing_address_collection = 'required'

session_id = session['id']
return render_template("web.html", data=session_id)

[edit by admin: formatting]

Is that the exact code you're using? I'd expect the last two lines, where you set the session_id variable and render the template, to be indented so that they're inside the view function. The variable email also doesn't look like it's necessary.