每当用户在结帐时输入空字符串时,会闪烁以下错误消息:
Credit card number is required. (81714)
我想展示:
而不是向用户展示Credit card number is needed to process your order.
我相信代码在这里:https://github.com/braintree/braintree_ruby/blob/master/lib/braintree/error_codes.rb
简化代码:
module Braintree
module ErrorCodes
module CreditCard
NumberIsRequired = "81714"
end
end
end
尝试使用以下装饰器
Braintree::ErrorCodes::CreditCard.class_eval do
NumberIsRequired = "We need a credit card to process your order"
end
这是实现这一目标的正确方法吗?是braintree在其他地方存储错误?
我正在使用rails 3和Spree 1.3
提前感谢您的帮助!