Payola Gem, getting No route matches [GET] "/payola/events"

83 views Asked by At

I'm using Payola-payments 1.5.1 with Rails 5.0.1 and running into the following error when I attempt to make a payment on a Stripe test-mode account: No route matches [GET] "/payola/events" Payola has a route to "/payola/events" which leads to the Webhooks Controller, but it only responds to the Post method. This is a redirect from the Transaction Controller, and the parameters being passed are {"action"=>"new", "controller"=>"users/sessions"}

Payola previously worked fine on my computer. The only changes I can think of were some gem-updates, including the switch to 5.0.1.

Has anybody run into this before? Any help would be greatly appreciated.

1

There are 1 answers

1
Cole Phiper On

Override the default route given by Payola Engine. I setup my routes like this. It's working on Rails 5.2.

  scope module: 'payola' do
    mount StripeEvent::Engine => 'payola/events', as: :payola
    post 'payola/buy/:product_class/:permalink' => 'transactions#create', as: :buy
    get 'payola/confirm/:guid' => 'transactions#show', as: :confirm
    get 'payola/status/:guid' => 'transactions#status', as: :status
    post 'payola/subscribe/:plan_class/:plan_id' => 'subscriptions#create', as: :subscribe
    get 'payola/confirm_subscription/:guid' => 'subscriptions#show', as: :confirm_subscription
    get 'payola/subscription_status/:guid' => 'subscriptions#status', as: :subscription_status
    delete 'payola/cancel_subscription/:guid' => 'subscriptions#destroy', as: :cancel_subscription
    post 'payola/change_plan/:guid' => 'subscriptions#change_plan', as: :change_subscription_plan
    post 'payola/change_quantity/:guid' => 'subscriptions#change_quantity', as: :change_subscription_quantity
    post 'payola/update_card/:guid' => 'subscriptions#update_card', as: :update_card
    post 'payola/update_customer/:id' => 'customers#update', as: :update_customer
    post 'payola/create_card/:customer_id' => 'cards#create', as: :create_card
    delete 'payola/destroy_card/:id/:customer_id' => 'cards#destroy', as: :destroy_card
  end

Lastly, deactivate disable_with, which is on by default with Rails 5.0+, I believe. It will stop the JS form code that Payola uses to process payments.

<%= f.submit "Submit" data: {disable_with: false} %>