uninitialized constant SolidusPaypalBraintree::Gateway (NameError) #4746
Answered
by
waiting-for-dev
czepesch
asked this question in
Troubleshooting
-
Hello! ruby 3.1.2 |
Beta Was this translation helpful? Give feedback.
Answered by
waiting-for-dev
Nov 29, 2022
Replies: 1 comment
-
Since Rails 7 is no longer possible to reference reloadable constants in an initializer. Probably, you need to change to: Rails.application.config.to_prepare do
Spree::Config.static_model_preferences.add(
SolidusPaypalBraintree::Gateway,
'braintree_credentials', {
environment: Rails.env.production? ? 'production' : 'sandbox',
merchant_id: ENV['BRAINTREE_MERCHANT_ID'],
public_key: ENV['BRAINTREE_PUBLIC_KEY'],
private_key: ENV['BRAINTREE_PRIVATE_KEY'],
paypal_flow: 'vault', # 'checkout' is accepted too
use_data_collector: true # Fingerprint the user's browser when using Paypal
}
)
end I created a PR to update the README. Thanks for reporting. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
waiting-for-dev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since Rails 7 is no longer possible to reference reloadable constants in an initializer. Probably, you need to change to:
I created a PR to update the README.
Thanks for…