I am using the PayPal Permissions SDK (Classic/NVP) to seek authorisation for third party payments.
The first time someone clicks on my button that redirects them to PayPal to login and authorise the request they get end up at the PayPal home page. If they go back and click my button again, it works this time and takes them to the right PayPal page.
Here is my code:
RequestPermissionsRequest rp = new RequestPermissionsRequest();
rp.scope = new List<string>();
rp.scope.Add("EXPRESS_CHECKOUT");
rp.callback = "my return url here";
rp.requestEnvelope = new RequestEnvelope("en_US");
RequestPermissionsResponse rpr = null;
PermissionsService service = new PermissionsService(PayPalClassicHelpers.Configuration.GetAcctAndConfig());
rpr = service.RequestPermissions(rp);
Response.Redirect("https://www.paypal.com/webscr&cmd=_grant-permission&request_token=" + rpr.token);
This redirects them to the PayPal URL:
https://www.paypal.com/webscr&cmd=_grant-permission&request_token=***rpr.token value***
But the first time they end up here:
https://www.paypal.com/us/home
Looking at the request and response headers, the first time I see this:
On subsequent requests there is no POST to https://www.paypal.com/auth/validatecaptcha
.
I have tried this on a few networks and computers and it is always the same.
Has anyone experienced this and know of the cause and a solution?
Just use '?' symbol after the webscr.
For example, change
https://www.paypal.com/webscr&cmd=_grant-permission&request_token=
to
https://www.paypal.com/webscr?cmd=_grant-permission&request_token=