jakeyeaton16
# | Name |
---|---|
26 |
Meta Tags
|
134 |
Ruby Go Lang Extensions
|
Hello,
I followed all instructions but for some reason I still can't see the webhook's info on my** view**.
Do you mind checking my code and help me understand what I did wrong?
Thank you
So I checked my logs again and I found that I'm getting this error:
*ArgumentError (Before process_action callback :verify_authenticity_token has not been defined):
*
I understand that it's in my webhooks_controller.rb but I'm not sure how to fix that.
Hmm... Yes it looks like that.
Here is my webhooks_controller.rb:
class WebhooksController < StripeEvent::WebhookController skip_before_action :verify_authenticity_token end
Yes, I restarted the server then refreshed my /users/edit page where the users card info should be showing and this is my entire logs:
=> Booting Puma => Rails 5.1.4 application starting in development => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.11.2 (ruby 2.4.1-p111), codename: Love Song * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://0.0.0.0:3000 Use Ctrl-C to stop Started POST "/stripe/event" for 54.187.205.235 at 2018-02-06 14:00:31 -0700 Cannot render console from 54.187.205.235! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255 (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ArgumentError (Before process_action callback :verify_authenticity_token has not been defined): app/controllers/webhooks_controller.rb:2:in `<class:WebhooksController>' app/controllers/webhooks_controller.rb:1:in `<top (required)>' Started GET "/users/edit" for 127.0.0.1 at 2018-02-06 14:00:44 -0700 Processing by Devise::RegistrationsController#edit as HTML User Load (0.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id ", 1], ["LIMIT", 1]] Rendering devise/registrations/edit.html.erb within layouts/application Charge Load (0.4ms) SELECT "charges".* FROM "charges" WHERE "charges"."user_id" = $1 [["user_id", 1]] Rendered devise/registrations/edit.html.erb within layouts/application (48.4ms) Rendered layouts/templates/_header.html.erb (3.0ms) Rendered layouts/templates/_footer.html.erb (0.5ms) Completed 200 OK in 421ms (Views: 364.5ms | ActiveRecord: 15.8ms | Solr: 0.0ms
Like this?
mount StripeEvent::Engine, at: '/stripe/event' # post '/stripe/event', to: 'webhooks#event' devise_for :users resources :subscriptions, only: [:new, :create] do scope module: 'subscriptions' do collection do resource :unsubscribe, only: :destroy resource :resubscribe, only: :new end end end
Alright, update.
It's working now.
I think what was the matter was that it didn't have to load the stripe results for the first time or something!
Sorta odd I know. But at least people in the future will know that a way to troubleshoot this issue is to wait it out and come back later.
Also try to delete all charges then create a new charge.
I have been trying to get this to work for little bit now and I'm wondering if it's because i'm using form_with. Do you know how to work around this?
This is what I have:
<%= form_with(model: listing, local: true, html: { id: 'new-listing-form' }, validate: true) do |form| %>
Hmm... shoot.
So if a person wants to use form_with they will need to use good old fashion jQuery validation?
Yeah it does haha
By the way. Do you have a video about how to create the commenting style like you have? It's much like Reddit :)