Search code examples
asp.net-mvcpaypalpaypal-sandboxpaypal-adaptive-payments

PayPal API Sandbox - "For security reasons, this page is no longer available"


I'm working with the PayPal API and am trying to create an account as shown here.

The request is made to https://svcs.sandbox.paypal.com/AdaptiveAccounts/CreateAccount.

I'm able to send a valid request and get a response indicating success back but the redirect URL that's also returned as part of the response payload (which according to their docs is supposed to take the user to a PayPal sign up/registration page) is directing them to the following:

Redirect page

I've been unable to find anything on Stackoverflow or Google regarding this. Has anyone encountered this before? I'm assuming that even though it's a sandbox environment it should allow me to simulate the workflow somehow. I've tried with both the default sandbox credentials as well as for my own environment.


Solution

  • Looks like the issue was due to the IP address header in the request. The default configuration is:

    -H "X-PAYPAL-DEVICE-IPADDRESS: 192.0.2.0"
    

    While testing on localhost, I changed it to:

    -H "X-PAYPAL-DEVICE-IPADDRESS: 127.0.0.1"
    

    Also had to ensure that the email address didn't already have an account registered to it - in which case it would lead to a login page instead of the registration page (which is a little poorly designed in my opinion since you can't really test without making new accounts each time).