首页 > 解决方案 > 如何在 Spree 中为新的付款设置设置付款来源?

问题描述

我正在尝试在 Rails 5.2 和 Spree 3.7.4 应用程序中配置新的付款设置 (EFT)。这是我的付款设置狂欢管理部分的样子:在此处输入图像描述

1:我的本地主机管理员/payment_methods/ https://i.stack.imgur.com/03QSS.png

而且我还设置了 config/initializers/spree.rb

# frozen_string_literal: true

# Configure Spree Preferences
#
# Note: Initializing preferences available within the Admin will overwrite any changes that were made
#         through the user interface when you restart.
#       If you would like users to be able to update a setting with the Admin it should NOT be set here.
#
# Note: If a preference is set here it will be stored within the cache & database upon initialization.
#       Just removing an entry from this initializer will not make the preference value go away.
#       Instead you must either set a new value or remove entry, clear cache, and remove database entry.
#
# In order to initialize a setting do:
# config.setting_name = 'new value'
Spree.config do |config|
  config.tax_using_ship_address = false
  config.require_master_price = false
end

# Configure Spree Dependencies
#
# Note: If a dependency is set here it will NOT be stored within the cache & database upon initialization.
#       Just removing an entry from this initializer will make the dependency value go away.
#
Spree.dependencies do |dependencies|
  # Example:
  # Uncomment to change the default Service handling adding Items to Cart
  # dependencies.cart_add_item_service = 'MyNewAwesomeService'
end

Spree.user_class = 'Spree::User'

Rails.application.config.spree.payment_methods << Spree::Gateway::GooglePay
Rails.application.config.spree.payment_methods << Spree::Gateway::Eft

当我尝试在本地通过 EFT 结帐时,我得到一个“{:”payments.source”=>[“can't be blank”]}”.. 请查看屏幕截图payment.source locahost 错误

如何在新的 Spree 支付网关中设置支付来源?

标签: ruby-on-railsruby-on-rails-5spree

解决方案


推荐阅读