Reputation: 10772
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?
Upvotes: 0
Views: 327
Reputation: 26
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=
Upvotes: 1
Reputation: 457
I am not sure but I have experienced the same issue when testing and debugging my code for PayPal recurring billing.
This is, most of the times in my case is because user is already logged in with other account and PayPal saved some cookies in the browser.
This might be the saved cookies issue and various accounts often used during development, such as sandbox seller and sandbox buyer.
Do check that and see if issues persist.
Again These are just my experiences and if your real users are actually experiencing this in production app then it might be something else completely.
Upvotes: 0