Search code examples
paypalpaypal-sandbox

How to programmatically approve order using PayPal v2 orders API


I would like to use my sandbox mock customer credentials to programmatically approve 'order with intent to capture' I created earlier using the new v2 orders api.

My end goal is to have an end to end test where an order is created, approved, captured and refunded.


Solution

  • There is no PayPal method for programmatically approving an order. The two methods for approving an order are redirecting a user agent to the approval_url (legacy method), or using an in-context Smart Button (recommended).