【发布时间】:2012-09-01 02:28:32
【问题描述】:
我正在尝试在我的应用中使用 ActiveMerchant 来实现 paypal 服务。我的开发者的贝宝账户是为 API 证书凭证设置的。以下代码在与 API 签名一起使用时效果很好,但在我尝试实现 API 证书时出现错误。有人可以帮忙吗?
PAYPAL_CERT_PEM = File.read("#{Rails.root}/certs/paypal_cert_dev.pem")
config.after_initialize do
ActiveMerchant::Billing::Base.mode = :test
paypal_options = {
:login => "****************",
:password => "**************",
:certificate => PAYPAL_CERT_PEM
}
::STANDARD_GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(paypal_options)
end
错误:
/Library/Ruby/Gems/1.8/gems/activemerchant-1.12.1/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb:72:in `initialize': An API Certificate or API Signature is required to make requests to PayPal (ArgumentError)
【问题讨论】:
标签: paypal activemerchant