Commit 6fd681e6 authored by Alexander Mamonchik's avatar Alexander Mamonchik
Browse files

Merge pull request #322 from lucas-aragno/master

Avoid to require an api key to get the instance working
parents 3b2a7dde 0da90e24
......@@ -4,6 +4,8 @@ module StripeMock
include StripeMock::RequestHandlers::Helpers
include StripeMock::RequestHandlers::ParamValidators
DUMMY_API_KEY = (0...32).map { (65 + rand(26)).chr }.join.downcase
# Handlers are ordered by priority
@@handlers = []
......@@ -71,7 +73,7 @@ module StripeMock
def mock_request(method, url, api_key, params={}, headers={}, api_base_url=nil)
return {} if method == :xtest
api_key ||= Stripe.api_key
api_key ||= (Stripe.api_key || DUMMY_API_KEY)
# Ensure params hash has symbols as keys
params = Stripe::Util.symbolize_names(params)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment