Closed MarkDBlackwell closed 11 years ago
The README file explains: "Two sets of keys are available: one for testing, one for live transactions. Use the testing keys on your development machine. When you deploy, use the live keys."
In development and testing, on your local machine, I recommend installing the "test" set of keys, either in Unix environment variables or using the config/application.yml file. It's easy to get the Stripe keys and install them and your testing will be realistic. In production, deploy the app and set the "live" API keys on the production server. You can still test locally with the "test" API keys even after you deploy to production.
Have I fully addressed your concerns? Any questions?
I believe your explanation is right for programmer end-users and others.
One implication of your answer seems to be that safe CI testing of this generated example app is possible if we provide test keys to the CI server.
In addition to a developer acquiring an account with Stripe, Googling "mock Stripe" reveals software which can mock out the actual invocation of Stripe for testing purposes.
The README recommends we set Stripe's API keys.
That's all well and good, but IMHO it should be enforced by a (non-test) Rails initializer instead of by tests.
Some routine development work on the Rails Example App should be possible without entering the Stripe keys. For example: making sure new gem and Ruby versions don't break the tests.
The Cucumber tests should employ some kind of Stripe testbed mode, or perhaps should mock the Stripe service. Does Stripe have a test mode? Or otherwise accept dummy, unreal values for STRIPE_API_KEY and STRIPE_PUBLIC_KEY?
Anyway, I'm getting these test failures: