ruby-on-rails - 如何在 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 支付网关中设置支付来源?
解决方案
推荐阅读
- c# - 将存档文件中的 Stream 转换为 Byte[]
- python - 从 selenium 中,如何通过 id 查找值?
- android - 我必须安装 Android SDK 才能开发 Android 应用程序吗?
- node.js - 使用贝宝安全付款
- java - Java 命名文件
- xml - 为路径组合变量
- ios - 有没有办法在 Windows 上构建 IOS 应用程序?
- wpf - WPF 覆盖 TabControl 的选项卡内容对齐方式
- android - 为什么这段代码只在 9.0 Pie 上崩溃?
- wordpress - 我可以在 wordpress 的自定义链接菜单上添加 onClick() 事件吗?