Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error message "Invalid request: {0}" #77

Open
cis-pjain opened this issue Jan 13, 2014 · 1 comment
Open

Getting error message "Invalid request: {0}" #77

cis-pjain opened this issue Jan 13, 2014 · 1 comment

Comments

@cis-pjain
Copy link

Hello,

I am getting error response {"responseEnvelope"=>{"timestamp"=>"2014-01-13T03:36:10.038-08:00", "ack"=>"Failure", "correlationId"=>"a668cb42ba8d5", "build"=>"7935900"}, "error"=>[{"errorId"=>"580001", "domain"=>"PLATFORM", "subdomain"=>"Application", "severity"=>"Error", "category"=>"Application", "message"=>"Invalid request: {0}"}]}

I have run the following code

data = {
  "returnUrl" => root_url, 
  "requestEnvelope" => {"errorLanguage" => "en_US"},
  "currencyCode"=>"USD",  
  "receiverList"=> { "receiver"=>[{ "email"=>self.paypal_email, "amount"=> self.amount}]},
  "cancelUrl"=>root_url,
  "actionType"=>"CREATE",
  "ipnNotificationUrl"=>root_url,
  "startingDate" => DateTime.now
}
preapproval = pay_request.preapproval(data)
pay_response = pay_request.pay(data)
self.pay_key = pay_response["payKey"]
self.paypal_status = "Payed"
execute_payment = pay_request.execute_payment(pay_response["payKey"])

Please help me out from this...

Thanks in advance

@KonstantinKo
Copy link

I had the same issue. For me, I didn't submit the amount as a String (like "19.99"). Just call data.to_json and see if everything seems valid.
Hope that helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants