2

When i use this API "https://api.sandbox.paypal.com/v1/payments/payment" for get "approval_url".

It's give error like :

{"name":"VALIDATION_ERROR","details":[{"field":"redirect_urls","issue":"This field required when payment_method is 'paypal'"}],"message":"Invalid request

see details ","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"e48112ca1cd19"}

I already mention parameter. This is my array.

{  
    "intent":"sale",
    "experience_profile_id":"XP-AAAA-AAAA-AAAA-AAAA",
    "payer":{  
        "payment_method":"paypal"
    },
    "transactions":[  
        {  
            "amount":{  
                "total":"9.00",
                "currency":"EUR"
            }
        }
    ]
},
"redirect_urls":{  
    "return_url":"http://example.com/success",
    "cancel_url":"http:/example.com/error"
}

Please let me know what is the issue.

Thanks In Advance

Dhaval
  • 89
  • 2
  • 11
  • I think the returned error is pretty clear.. you must include the `redirect_urls` parameter when doing the request. It seems it is an array of urls to redirect to – Mihai Matei May 03 '18 at 10:49
  • You put the ending } too early. The object is closed without containing the redirect_urls param – Mihai Matei May 03 '18 at 10:59
  • 1
    `{ "intent":"sale", "experience_profile_id":"XP-AAAA-AAAA-AAAA-AAAA", "payer":{ "payment_method":"paypal" }, "transactions":[ { "amount":{ "total":"9.00", "currency":"EUR" } } ] , "redirect_urls":{ "return_url":"http://example.com/success", "cancel_url":"http:/example.com/error" }}` – Mihai Matei May 03 '18 at 11:00
  • Yes,Got it Thanks – Dhaval May 03 '18 at 11:01

0 Answers0