Rails PayPal自适应 [英] Rails PayPal adaptive

查看:85
本文介绍了Rails PayPal自适应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 paypal_adaptive gem,但遇到了一些问题. 这是我在config/paypal_adaptive.yml中的代码:

I am using paypal_adaptive gem and having some problems. This is my code in 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凭据,但两种方法均无法正常工作. 这是控制付款的控制器代码:

of course the XXX is the real details. I also tried with the API credentials that were given me, didn't work either way. Here's the controller code which controls the payment:

> pay_request = PaypalAdaptive :: Request.new

> 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时,我得到以下数组(包含错误):

I am getting the following array (which contains the error) when trying to output pay_response:

> ["responseEnvelope",{"timestamp" =>"2011-05-03T12:00:54.107-07:00","ack" =>"Failure","correlationId" =>"242e1fc31cf18","build" => "1846084"}] [错误",[{错误ID" =>"560022",域" =>平台",子域" =>应用程序",严重性" =>错误",类别"=>"应用程序,"消息"=>" X-PAYPAL-APPLICATION-ID标头包含无效值,"参数"=> [[" X-PAYPAL-APPLICATION-ID]}]]]]

> ["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"=>"The X-PAYPAL-APPLICATION-ID header contains an invalid value", "parameter"=>["X-PAYPAL-APPLICATION-ID"]}]]

我真的很绝望.预先感谢.

I am really hopeless. Thanks in advance.

推荐答案

实际上,我从未使用过它,我自己在做付款工作.然后我发现编辑YAML后没有重置服务器! :D

Actually I never got it to work, I was doing the payment stuff by myself. Then I figured I didn't reset my server after editing the YAML! :D

还是谢谢!

这篇关于Rails PayPal自适应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆