我是使用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 header包含无效值", "parameter"=>["X-PAYPAL-APPLICATION-ID"]}]]
我真的很绝望。提前感谢。