bennington-hardware-hacking-2019 / pos_system

Automated Point of Sale System using NFC
MIT License
54 stars 14 forks source link

stripe api connection error #36

Open hoanhan101 opened 5 years ago

hoanhan101 commented 5 years ago

calling stripe.Charge.create() under a flask/websocket endpoint raises

stripe.error.APIConnectionError: Unexpected error communicating with Stripe. It looks like there's
probably a configuration issue locally.

while calling it outside is fine.

hoanhan101 commented 5 years ago

did some debugging with @julianlambert today, it turned out that, the error was caused by the use of eventlet.monkey_patch() - how we handled websocket threading.

it turns out that stripe can't be monkey patched 🐒. dang.

Basically that means that because stripe is still running in a blocking way instead of asynchronously it cannot function with our server. SO, we are gonna use stripe from the front end instead and just send the payment data to a backend web-socket.

hoanhan101 commented 5 years ago

@julianlambert will you please build the front end stripe api communication — translate the stripe payment processor to the front end please? — sincerely julian (from hoanhs computer)

awbry commented 5 years ago

Options for fixing stripe payment

hoanhan101 commented 5 years ago

@acencini suggested to use gunicorn instead of eventlet at the class demo today