Usage
Rails 3
Gemfile
gem 'devise_webmoney'
gem "rack-webmoney"
adding wmid column:
rails g migration add_wmid_to_user
and add this:
def self.up
add_column :users, :wmid, :string, :limit => 12
add_index :users, :wmid, :unique => true
end
def self.down
remove_column :users, :wmid
end
application.rb
...
config.middleware.insert_before(Warden::Manager, Rack::Webmoney,
:credentials => { :site_holder_wmid => 'your_site_wmid',
:app_rids => { 'localhost' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'example.com' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' }},
:mode => Rails.env)
...
config/initializers/devise.rb
config.webmoney_auto_register = true
user.rb
devise :webmoney_authenticatable
Your authentication form should return params == ‘webmoney’ form Webmoney authentication process begin.