#mxd

1 messages ยท Page 1 of 1 (latest)

warm meteorBOT
upper patrol
#

Hello ๐Ÿ‘‹
Can you provide more information about this?
What error are you seeing?

thick crescent
#

i downloaded the app and ran it

#

i get the following

#

Not Found

127.0.0.1 - - [25/Oct/2022 09:53:58] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 09:54:01] "GET /create-checkout-session HTTP/1.1" 404 -```
#

in the browser

#

this is the route provided by stripe : @app.route('/', methods=['GET']) def get_index(): return current_app.send_static_file('index.html')

#

but theres not even an index.html file in the public directory

upper patrol
#

I don't think there's an index.html file in the sample
You may need to create one of your own

thick crescent
#

yeah so i did that

#

and it doesn't detect the index

#

i tried the /checkout route and same thing, 404 error

upper patrol
#

did you try restarting the server?

thick crescent
#

yes of course

upper patrol
#

gotcha. give me a couple minutes, let me see if I can reproduce this behavior

thick crescent
#
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:4242/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 176-922-053
127.0.0.1 - - [25/Oct/2022 10:17:29] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:17:30] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:17:30] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:17:32] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:19:03] "GET /checkout HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:19:15] "GET /cancel HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:19:26] "GET /create-portal-session HTTP/1.1" 404 -
127.0.0.1 - - [25/Oct/2022 10:19:40] "GET /create-checkout-session HTTP/1.1" 404 -```
upper patrol
thick crescent
#

whoa

upper patrol
#

I think the example doc needs to call this out explicitly but since there's no index file, the route fails

thick crescent
#

yes! do you have the power to change it?

#

and add a ? to checkout.html is the way to make it work?

upper patrol
#

no sorry, question mark was supposed to be outside the url

#

/create-checkout-session is a POST path

#

Checkout.html calls this route and generates a checkout session

thick crescent
#

yeah that works now, except for when i click checkout, theres the server error

#
list index out of range
127.0.0.1 - - [25/Oct/2022 10:24:51] "POST /create-checkout-session HTTP/1.1" 500 -```
upper patrol
#

huh that seems to be coming from your server.js or server.py file.
I don't see an error on my end after downloading the example a few minutes ago

thick crescent
#

i dont have a server.js, i have a client.js

upper patrol
#

there should be one outside the public folder

#

This is what the source looks like

thick crescent
#

no im using the python flask app

upper patrol
#

yeah but it should look similar I think

#

let me check

thick crescent
upper patrol
#

yeah that's the file I'm referring to.

thick crescent
#

um

#

do you think its due to the lookup keys?

#

that was another thing i found in the quickstart

#

yeah Idk, im literally using the code provided

upper patrol
#

Give me a couple of minutes to download and reproduce

#

Can you open your network console to see if you have any errors there?

thick crescent
#

all i got was:

upper patrol
#

can you try adding a print statement in your create-checkout-session method in server.py ?

#

to see what's exactly causing this 500

thick crescent
#

i got ```127.0.0.1 - - [25/Oct/2022 10:46:11] "GET /checkout.html HTTP/1.1" 200 -
list index out of range

#

i created a subscription already and used the correct test_keys but its not picking anything up it looks like

#

parameter_invalid_empty - lookup_keys[0]
You passed an empty string for 'lookup_keys[0]'. We assume empty values are an attempt to unset a parameter; however 'lookup_keys[0]' cannot be unset. You should remove 'lookup_keys[0]' from your request or supply a non-empty value.

upper patrol
thick crescent
#

yeah so this is the error i encountered, something is confusing in the lookup docs

upper patrol
thick crescent
#

ok so I tried it and still same error

#
        <!-- Add a hidden field with the lookup_key of your Price -->
        <input type="hidden" name="lookup_key" value="20.00" />
        <button id="checkout-and-portal-button" type="submit">Checkout</button>
      </form>```
#

i added the value 20.00 for the lookup key

#

idk

#

what now?

#

try a bunch of stuff and come back?

upper patrol
#

That's the point of quickstart guides ๐Ÿ™‚
You can use it as a reference to build your own integration

thick crescent
#

i dont have any confidence if I cant get the quickstart to operate ...

upper patrol
thick crescent
#

ok ill try that ....

#

thanks for the help, and for your time

upper patrol
#

NP! ๐Ÿ™‚ Happy to help
Good luck