[英]Rails PayPal adaptive
我正在使用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 憑據,但無論哪種方式都不起作用。 這是控制付款的 controller 代碼:
> 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)
嘗試 output 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"]}]]
我真的絕望了。 提前致謝。
確保在更改密鑰后重新啟動 Rails 服務器
The Answer is, Your post url, check that your posting to the Sandbox or live https://svcs.sandbox.paypal.com/AdaptivePayments/Pay if your using a Sandbox ID make sure your using a Sandbox url..
這與您的 YAML 格式相同還是縮進正確? 嘗試重新格式化您的 YAML。 由於 YAML 格式錯誤,我過去也遇到過類似的問題。
實際上我從來沒有讓它工作,我自己做付款的事情。 然后我想在編輯 YAML 后我沒有重置我的服務器::D
不管怎么說,多謝拉!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.