【发布时间】:2011-10-17 08:01:51
【问题描述】:
我有 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() 调用传播。
知道我的设置有什么问题吗?
谢谢。
【问题讨论】:
-
一种变通方法可能是将
require "stringio"放在代码的顶部,但您不需要这样做。 -
嘿,非常感谢您的回答。这对我有用,但为什么会这样?还有其他好的解决方法吗?这是我使用的 gem 版本的问题吗?还有其他人面临这个问题吗?
-
我不知道。我会将 ruby on rails 标记添加到这个问题中,看看是否有其他人解决它。
-
还是没有反应!让我们看看现在有赏金是否有更多的兴趣。
标签: ruby-on-rails ruby activemerchant activesupport