当我尝试条带连接时,我的服务器上的路由无效

时间:2015-07-27 02:05:38

标签: ruby-on-rails stripe-payments stripe-connect

所以我按照本教程:http://www.munocreative.com/nerd-notes/winvoice 还有:https://github.com/isaacsanders/omniauth-stripe-connect

当我跳过表格时,我被发送到我的uri,我已经设置了我的连接设置,但我明白了:

No route matches [GET] "/users/auth/stripe_connect/callback"

这是我的routes.rb文件

Rails.application.routes.draw do
root 'index#home'
devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" }
end

这是我的omniauth_callbacks_controller.rb

class OmniauthCallbacksController < Devise::OmniauthCallbacksController
  def stripe_connect
    @user = current_user
    if @user.update_attributes({
      provider: request.env["omniauth.auth"].provider,
      uid: request.env["omniauth.auth"].uid,
      access_code: request.env["omniauth.auth"].credentials.token,
      publishable_key: request.env["omniauth.auth"].info.stripe_publishable_key
    })
      # anything else you need to do in response..
      sign_in_and_redirect @user, :event => :authentication
      set_flash_message(:notice, :success, :kind => "Stripe") if is_navigational_format?
    else
      session["devise.stripe_connect_data"] = request.env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end

您需要我提供的任何其他细节,请问。感谢。

0 个答案:

没有答案