Stripe Import for Python

Hello all,

Last night I was working on my e-commerce application which I have chosen to build on Flask and Serverless. Everything has gone very well up to this point and I am almost finished, but when I was working on the backend transaction processing and using the stripe API’s, I’ve run into a problem. Whenever I run my application in my local environment, everything works perfectly fine and smoothly, but when I deploy the application to AWS with serverless, I get this error “{“message”: “Internal server error”}”. Now, I have encountered this error before and it was due to an import configuration that I needed to make, so I believe this is the same case. How do I import stripe within my main routing file? I’ve installed Stripe using node (npm install stripe). Does anyone know how to do this?


Did you solve your problem ?
I think that I have the same, the lambda show this error because the call on Stripe API doesn’t return before the lambda timeout (I teseted to set 10 seconds, and I still got this error).

[Update] My problem was that my lambda was in private network (to access RDS instance), and I didn’t set up a NAT gateway to provide internet access to this private network :