Rack Web Monetization Middleware
The Rack Web Monetization Middleware offers support for handling status updates from the Web Monetization API.
The middleware will process the status updates sent from a client, and if it is a valid status update it will pass it through the rest of the stack. If it is not a valid status then it will return a 403
HTTP status code to the application.
Installation
Add this line to your application's Gemfile:
gem 'rack-monetize'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-monetize
Usage
You can use rack-monetize
either in a standalone application or mounted into a Rails application.
As a standalone application
Install the gem on your system:
$ gem install rack-monetize
Then require it from within your config.ru
Rack configuration:
use Rack::Monetize::ProcessMonetizeState
An example config.ru can be found in the examples folder. More information on getting up and running with Rack can be found at the Rack GitHub repository.
Mounted into a Rails Application
Require it in your Gemfile
:
gem rack-monetize
And then add the middleware to your config/application.rb
file to initialize it with your application:
config.middleware.use Rack::Monetize::ProcessMonetizeState
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/benhayehudi/rack-monetize. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Rack::Monetize project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.