Hi all, still on this PayPal issue, a couple of er...
# support
k
Hi all, still on this PayPal issue, a couple of errors I forgot to add to previous comment:
Copy code
Can't verify CSRF token authenticity.
Completed 422 Unprocessable Entity in 1ms (ActiveRecord: 0.0ms | Allocations: 574)
  
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
Wondering if it’s something to do with a frontend change with tokens vs new solidus front end, or if it’s a Rails 5.2 > Rails 6 issue? Any help massively appreciated. Thanks again
r
I recommend reading https://guides.rubyonrails.org/security.html#cross-site-request-forgery-csrf It looks like you are using
:exception
for the
forgery_protection_strategy
on the controller. It seems that your transaction request is coming from the PayPal button? In that case, it uses Ajax: https://github.com/solidusio/solidus_paypal_braintree/blob/021ff881022d6ce7c165a1c[…]pp/assets/javascripts/solidus_paypal_braintree/paypal_button.js So maybe you’re missing a
/= require jquery_ujs
on the JS layout that you use on the payment page?
k
Ahh that might be it! We are using rails-ujs. I will try it and get back to you. Thanks so much again
👍 1
s
So I tried adding
gem 'jquery-rails'
and then required it on checkout/payment like below:
//= require jquery
//= require jquery_ujs
But still same thing happening
r
what solidus frontend gem are you both using?
s
And these are the
data: params
used for
Spree.ajax
call