README.md in fake_stripe-0.0.10.6 vs README.md in fake_stripe-0.0.11
- old
+ new
@@ -19,27 +19,43 @@
end
```
Remember to run `bundle install`.
+### Rails 5 Compatibility
+
+`fake_stripe` depends on Sinatra, which is currently in the process of being
+upgraded to use Rack 2.0, a requirement for compatibility with Rails 5. This
+should be resolved once Sinatra 2.0 is officially released; in the meantime,
+you can add `gem 'sinatra', '2.0.0.beta2'` to the `:test` group in your Gemfile.
+
### Stripe settings
Set the `STRIPE_JS_HOST` constant in an initializer:
```ruby
-# config/initilialzers/stripe.rb
+# config/initializers/stripe.rb
Stripe.api_key = ENV['STRIPE_API_KEY']
unless defined? STRIPE_JS_HOST
STRIPE_JS_HOST = 'https://js.stripe.com'
end
```
-Include the Stripe JavaScript in your application template:
+Include the Stripe JavaScript in your application template.
+If you're using Stripe.js v1:
+
```rhtml
# app/views/layouts/application.html.erb
<%= javascript_include_tag "#{STRIPE_JS_HOST}/v1/" %>
+```
+
+Or if you're using Stripe.js v2:
+
+```rhtml
+# app/views/layouts/application.html.erb
+<%= javascript_include_tag "#{STRIPE_JS_HOST}/v2/" %>
```
When the test suite runs `fake_stripe` will override the address for
`STRIPE_JS_HOST` and serve up a local version of [Stripe.js](https://stripe.com/docs/stripe.js).