I'm attempting to use solidus_stripe with the soli...
# support
b
I'm attempting to use solidus_stripe with the solidus_starter_frontend. When I get to the payment step it just says "loading..." under payment information. I can click save and continue and place order but it ends with the error: `NoMethodError (undefined method
type' for nil:NilClass payment_method_types: [payment.source.stripe_payment_method.type]
Which I assume is because I wasn't able to enter payment info.
Copy code
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/payment_intent.rb:117:in `block in create_stripe_intent'
stripe (8.3.0) lib/stripe/stripe_client.rb:206:in `request'
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/gateway.rb:194:in `request'
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/payment_intent.rb:109:in `create_stripe_intent'
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/payment_intent.rb:20:in `block in create_for_payment'
<internal:kernel>:90:in `tap'
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/payment_intent.rb:20:in `create_for_payment'
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/payment_intent.rb:10:in `prepare_for_payment'
solidus_stripe (5.0.0.rc.2) app/models/solidus_stripe/gateway.rb:111:in `purchase'
solidus_core (3.3.1) app/models/spree/payment_method.rb:41:in `purchase'
solidus_core (3.3.1) app/models/spree/payment/processing.rb:59:in `block in purchase!'
solidus_core (3.3.1) app/models/spree/payment/processing.rb:213:in `protect_from_connection_error'
solidus_core (3.3.1) app/models/spree/payment/processing.rb:58:in `purchase!'
solidus_core (3.3.1) app/models/spree/payment/processing.rb:29:in `process!'
solidus_core (3.3.1) app/models/spree/order/payments.rb:47:in `public_send'
solidus_core (3.3.1) app/models/spree/order/payments.rb:47:in `block in process_payments_with'
solidus_core (3.3.1) app/models/spree/order/payments.rb:44:in `each'
solidus_core (3.3.1) app/models/spree/order/payments.rb:44:in `process_payments_with'
solidus_core (3.3.1) app/models/spree/order/payments.rb:23:in `process_payments!'
solidus_core (3.3.1) app/models/spree/order.rb:743:in `process_payments_before_complete'
I'm having difficulty tracking down the problem since there is no console errors...
l
have you created a new Stripe payment method in the /admin interface ?
k
solidus stripe v5 is compatible with the started frontend v3.4. You probably need to adapt some views a little bit to display it properly. You can checkout the v3.4 branch here, and for reference, this is a PR that changed the payment page: https://github.com/solidusio/solidus_starter_frontend/pull/321
b
Yes, I created the payment method in /admin. Thanks for the reference, I'll check out my views
I haven't made any custom changes to the views, is there an install script to update all of the views to 3.4? ...nevermind, doesn't look like it because it's a template.
I'm getting an error on the payment page now. Where can i find this partial?
Copy code
Missing partial checkouts/payment/_stripe
stacktrace:
Copy code
actionview (7.0.4.2) lib/action_view/path_set.rb:49:in `find'
actionview (7.0.4.2) lib/action_view/lookup_context.rb:127:in `find'
actionview (7.0.4.2) lib/action_view/renderer/partial_renderer.rb:263:in `find_template'
actionview (7.0.4.2) lib/action_view/renderer/partial_renderer.rb:231:in `render'
actionview (7.0.4.2) lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
actionview (7.0.4.2) lib/action_view/renderer/renderer.rb:53:in `render_partial'
actionview (7.0.4.2) lib/action_view/helpers/rendering_helper.rb:44:in `render'
app/views/checkouts/steps/_payment_step.html.erb:52
app/views/checkouts/steps/_payment_step.html.erb:35:in `each'
app/views/checkouts/steps/_payment_step.html.erb:35:in `with_index'
app/views/checkouts/steps/_payment_step.html.erb:35
actionview (7.0.4.2) lib/action_view/base.rb:244:in `public_send'
actionview (7.0.4.2) lib/action_view/base.rb:244:in `_run'
actionview (7.0.4.2) lib/action_view/template.rb:157:in `block in render'
activesupport (7.0.4.2) lib/active_support/notifications.rb:208:in `instrument'
actionview (7.0.4.2) lib/action_view/template.rb:361:in `instrument_render_template'
actionview (7.0.4.2) lib/action_view/template.rb:155:in `render'
actionview (7.0.4.2) lib/action_view/renderer/partial_renderer.rb:251:in `block in render_partial_template'
activesupport (7.0.4.2) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.0.4.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (7.0.4.2) lib/active_support/notifications.rb:206:in `instrument'
actionview (7.0.4.2) lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
actionview (7.0.4.2) lib/action_view/renderer/partial_renderer.rb:237:in `render'
actionview (7.0.4.2) lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
actionview (7.0.4.2) lib/action_view/renderer/renderer.rb:53:in `render_partial'
actionview (7.0.4.2) lib/action_view/helpers/rendering_helper.rb:44:in `render'
app/views/checkouts/_checkout_step.html.erb:9
did you run
Copy code
bin/rails generate solidus_stripe:install
as suggested in the README?
b
Yes, I didn't realize I needed to run it again for the update. Thank you.
I have a fresh install of rails following the solidus instructions and then a fresh install of rails with a couple different build steps along the same lines as my production. It appears the only difference is esbuild vs importmaps and solidus_stripe doesn't render with the esbuild version.
Is there a way to enable using importmaps along side esbuild?
It seems the proper solution would be to include whatever is missing and not use importmaps alongside esbuild but I'm still digging through what's not being imported.
k
I don’t know if there’s a way, do you need esbuild for some specific reason?
b
The only difference I did on initial install was adding bootstrap and postgres like so: rails new my_store -d postgresql -c bootstrap and it included esbuild
So I assume bootstrap is the reason?
k
Apparently, there are some extra steps to have bootstrap working with Rails 7, see

https://www.youtube.com/watch?v=jyqjecyCv3A

b
Bootstrap is working for me, it's the solidus_stripe that's not rendering it's payment fields.
k
Can you please try without bootstrap first? You can probably add it later to your rails store and should be the same because the starter frontend provided doesn’t have anything related to bootstrap.
b
I did, it's working when I install without bootstrap and esbuild.
k
Cool, now I think it’s a matter of understand if/how either: • rails can work with both importmaps and esbuild • there’s a way to use bootstrap with importmaps
b
Ok, Is there not a way to get stripe_solidus to work with esbuild?
k
To be honest, I don’t know. We can only offer support for the default stack, unfortunately.
b
Alright, I'll report back if I find a solution. Thanks for the feedback.
The problem I was running into is that solidus_stripe is loaded with
@hotwired/stimulus
. So I needed to run
./bin/rails stimulus:manifest:update
in order to add the stripe controllers, and then compile my assets. I think the reason this is not needed when using importmaps is because it uses
eagerLoadControllersFrom
while esbuild requires each controller to be imported individually. https://stimulus.hotwired.dev/handbook/installing#using-other-build-systems
👍 1