eCommerce 3.3.0 Rails 5.1 Ruby2.5.7
我正试着把payment_selection拉到订单上。在Spree::OrdersController中,我使用:
payments.valid.first&.source
要明确的是,支付是一系列的狂欢::支付::CreditCard--而不是狂欢::Payment::Check。
发布于 2020-05-13 03:45:36
这完全取决于你使用的支付网关。即使它是一个基于CC的支付网关,也有一些没有将CC作为疯狂的来源。
狂欢中的每一种支付方法都有一个名为source_required?
:https://github.com/spree/spree/blob/a01ffd29b73f75cb234fcf5d368fb23553acf4d1/core/app/models/spree/payment_method.rb#L49的方法。
您应该检查正在使用的那个是否返回true
。
https://stackoverflow.com/questions/60266799
复制相似问题