REST API V2 to approve/execute payment with the buyer test account?

ViVa-Kakele
Contributor
Contributor

Hi,

 

I can't find this info on the PayPal docs. I am currently creating an order with the 'https://api.sandbox.paypal.com/v2/checkout/orders' request. Then the order stays at the 'CREATED' status. How can I approve the request at the sandbox buyer side without having to manually log in into the buyer in a browser? In other words, how can I execute a HTTP request (say with cURL) to change my test order to the 'APPROVED' status?

 

Thanks in advance

Login to Me Too
2 REPLIES 2

MTS-Aaron
PayPal Employee
PayPal Employee

Hi @ViVa-Kakele 

 

PayPal attempts to emulate Production as closely as possible with sandbox operations. Because of this, there is no way to bypass a user logging in and approving an order so far as I know. Not only is this good for consistency across live and sandbox, but also for the security of PayPal, Merchants, and their Buyers so that internal processes aren't revealed to those testing these transactions.

 

It's purely so that testing in sandbox can be as close to the real thing as possible.

 

I hope this helps. 

-Aaron

Login to Me Too

ViVa-Kakele
Contributor
Contributor

Thanks Aaron!

 

That is unfortunate. I still think that exposing 'test API' calls would be beneficial for developers, specially for programmatically executing buyer side actions. I am not sure I understand the security risk that exists in the sandbox, as it is supposed to be a test environment. The API docs right now don't mention anything about this limitation either.

 

It is hard to write an integration test with the current API, which many could benefit to keep their apps healthy (I don't want my app to break and my payments to not work!). I have created an alternative using Python and Selenium to execute the payment in the SandBox. If you think that is OK I can share it on GitHub publicly for others that need this as well.

 

Best regards

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.