solidusio / solidus_stripe

💳 Integrate Solidus with Stripe
https://stripe.com
BSD 3-Clause "New" or "Revised" License
36 stars 62 forks source link

Initializer fails with uninitialized constant Spree::PaymentMethod #133

Closed diegomichel closed 1 year ago

diegomichel commented 1 year ago

I added this to my spree/solidus initializer:

  config.static_model_preferences.add(
    Spree::PaymentMethod::StripeCreditCard,
    'stripe_env_credentials',
    secret_key: ENV['STRIPE_SECRET_KEY'],
    publishable_key: ENV['STRIPE_PUBLISHABLE_KEY'],
    stripe_country: 'US',
    v3_elements: false,
    v3_intents: true
  )

But looks like it does not work, looks like the classes are not loaded up and the initializer fails.

Calling the same class on the console after removing it from initializer works fine but not sure how to set the payment method at that step. As a workaround I set it up thru the admin section for now.

Gems:

gem 'rails', '>= 7.0.2.4'
gem "solidus", "~> 3.2"                                                                                                                                                                                                    
gem "solidus_frontend", "~> 3.2"                                                                                                                                                                                           
gem "solidus_stripe", "~> 4.3" 
weefunker commented 1 year ago

Did you get anywhere with this? Seems like the gem fails to run in the installer also

diegomichel commented 1 year ago

Not really, @weefunker. As a workaround, I set the Stripe keys on the admin section, which works fine.

kennyadsl commented 1 year ago

Maybe it's the same problem solved here https://github.com/solidusio/solidus_paypal_braintree/pull/332 ? I think it's a matter of updating the README, can you take care of that?

diegomichel commented 1 year ago

Glad to do it @kennyadsl https://github.com/solidusio/solidus_stripe/pull/136