Stripe Checkout / Selenium Demo
This is an unofficial demonstration of how to test a webapp using Stripe Checkout with Selenium in Python. You should already be familiar with https://stripe.com/docs/checkout and have implemented an application using Checkout before reading this.
This code is filled with horrible hacks. If anyone reading this has ideas for improvement, I'm open to them.
It goes something like this:
run_test.shfetches ChromeDriver runs
test.pystarts a server,
test.pystarts up Chrome, and connects to
server.pyhas a simple webapp that lets you specify an amount to pretend-pay, then accepts a pretend payment with Stripe Checkout.
test.pyuses Selenium to click through this process.
test.pychecks that the webapp reports success, and uses a debugging endpoint (
/payments) to check that the webapp indeed recorded the fake payment to the server.
test.pyrepeats this, the second time asking Chrome to emulate an iPhone 5, so the mobile Stripe Checkout interface is tested.
This code was written by Madeleine Thompson, who releases it into the public domain.
This code comes with no warranty. Use at your own risk.
The author has no affiliation with Stripe.