如何使用 PayPal v2 订单以编程方式批准订单 API

How to programmatically approve order using PayPal v2 orders API

我想使用我的沙盒模拟客户凭据以编程方式批准 'order with intent to capture' 我之前使用新的 v2 订单创建的 api。

我的最终目标是进行端到端测试,其中创建、批准、捕获和退款订单。

没有用于以编程方式批准订单的 PayPal 方法。批准订单的两种方法是将用户代理重定向到 approval_url(传统方法),或使用 in-context Smart Button(推荐)。