【发布时间】:2011-08-17 23:32:04
【问题描述】:
我正在使用paypal_adaptive gem 并且遇到了一些问题。 这是我在 config/paypal_adaptive.yml 中的代码:
development:
environment: "sandbox"
username: "x@gmail.com"
password: "xxx"
signature: "xxx"
application_id: "APP-80W284485P519543T"
test:
environment: "sandbox"
username: "x@gmail.com"
password: "xxx"
signature: "xxx"
application_id: "APP-80W284485P519543T"
enviorment:
environment: "sandbox"
username: "x@gmail.com"
password: "xxx"
signature: "xxxx"
application_id: "APP-80W284485P519543T"
当然XXX是真实的细节。我还尝试了使用给我的 API 凭据,但都不起作用。 这是控制支付的控制器代码:
> pay_request = PaypalAdaptive::Request.new
data = {
"returnUrl" => "http://localhost:3000/payments/completed_payment_request",
"requestEnvelope" => {"errorLanguage" => "en_US"},
"currencyCode"=>"USD",
"receiverList"=>{"receiver"=>[{"email"=>"xxx@gmail.com", "amount"=>"10.00"}]},
"cancelUrl"=>"http://localhost:3000/payments/canceled_payment_request",
"actionType"=>"PAY",
"ipnNotificationUrl"=>"http://localhost:3000/payments/ipn_notification"
}
@pay_response = pay_request.pay(data)
我在尝试输出 pay_response 时收到以下数组(其中包含错误):
> ["responseEnvelope", {"timestamp"=>"2011-05-03T12:00:54.107-07:00", "ack"=>"Failure", "correlationId"=>"242e1fc31cf18", "build"=> "1846084"}] ["error", [{"errorId"=>"560022", "domain"=>"PLATFORM", "subdomain"=>"Application", "severity"=>"Error", "category "=>"Application", "message"=>"X-PAYPAL-APPLICATION-ID 标头包含无效值", "parameter"=>["X-PAYPAL-APPLICATION-ID"]}]]
我真的很绝望。提前致谢。
【问题讨论】:
-
我遇到了同样的问题,但这是由于我的 paypal_adaptive.yml 文件中的 yaml 语法不正确造成的。修复它并重新启动应用程序似乎可以解决问题
-
嘿亚当,我也在做同样的事情,我想知道你在哪里找到/得到了那个应用程序 ID。它不会与我的其他 API 凭据一起出现在沙箱中。还是只是为了生产?
标签: ruby-on-rails paypal paypal-adaptive-payments