4

我正在使用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"]}]]

我真的绝望了。提前致谢。

4

4 回答 4

3

确保在更改密钥后重新启动 Rails 服务器

于 2012-10-18T22:12:34.450 回答
1

答案是,您的帖子网址,如果您使用沙盒 ID,请检查您发布到沙盒或实时 https://svcs.sandbox.paypal.com/AdaptivePayments/Pay的帖子, 确保您使用沙盒网址。

于 2011-10-19T05:23:49.187 回答
0

这与您的 YAML 格式相同还是缩进正确?尝试重新格式化您的 YAML。由于 YAML 格式错误,我过去也遇到过类似的问题。

于 2011-07-19T20:32:12.353 回答
-1

实际上我从来没有让它工作,我自己做付款的事情。然后我想我在编辑 YAML 后没有重置我的服务器!:D

无论如何谢谢!

于 2011-07-20T06:36:41.300 回答