Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 468

Automating the Creation of Sandbox Accounts for Testing

$
0
0

I've been working on automating the creation of sandbox accounts for my test environment, I need to find a way to create sandbox accounts dynamically by hitting PayPal's endpoint so I can test the payout functionalities on my platform but for that I need to add a new PayPal sandbox account to each new test user I create in my automated tests.

By inspecting the developers dashboard and looking at how the account creation works I attempted to use the following curl request to create a sandbox account via PayPal’s API (with my own access token that I got from following this steps):

curl 'https://developer.paypal.com/dashboard/api/accounts/createSimplifiedAccount' \  -H 'accept: application/json, text/plain, */*' \  -H 'accept-language: en-US,en;q=0.9' \  -H 'cache-control: no-cache' \  -H 'content-type: application/json' \  -H 'Authorization: Bearer <access_token>' \  -H 'origin: https://developer.paypal.com' \  --data-raw '{"country":"US","type":"PERSONAL","features":[]}'

As expected this request returned a 403 error. When inspecting the response, it seemed like PayPal redirected the request to an error page that did not yield any useful results for account creation. It suggests that either I don’t have the necessary permissions or the endpoint might not support sandbox account creation. Has anyone successfully automated sandbox account creation or is there an official API endpoint for this purpose that I might not be aware of?


Viewing all articles
Browse latest Browse all 468

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>