我有 activemerchant 1.16.0 和 rails 3.0.5。
我正在尝试构建一个基本代码来使用活跃的商家与 PayPal 的网关进行通信。
if credit_card.valid?
# or gateway.purchase to do both authorize and capture
response = gateway.authorize(1000, credit_card, :ip => "127.0.0.1")
if response.success?
gateway.capture(1000, response.authorization)
puts "Purchase complete!"
else
puts "Error: #{response.message}"
end
else
puts "Error: credit card is not valid. #{credit_card.errors.full_messages.join('. ')}"
end
我收到以下错误:
/Library/Ruby/Gems/1.8/gems/activesupport-3.0.9/lib/active_support/xml_mini/rexml.rb:20:in `parse': uninitialized constant ActiveSupport::XmlMini_REXML::StringIO (NameError)
此错误从gateway.authorize()
调用传播。知道我的设置有什么问题吗?谢谢。