This is how the data would look like: [ { "op": "replace", "path": "/transactions/0/amount", "value": { "total": "25.00", "currency": "USD", "details": { "subtotal": "17.50", "shipping": "6.20", "tax": "1.30" } } }, { "op": "add", "path": "/transactions/0/item_list/shipping_address", "value": { "recipient_name": "Gruneberg, Anna", "line1": "52 N Main St", "city": "San Jose", "postal_code": "95112", "country_code": "US", "state": "CA" } } ]
Update payment object by calling the
static update
method
on the Payment class by passing a valid
Payment ID
(See bootstrap.php for more on ApiContext
)
The API response provides the url that you must redirect the buyer to. Retrieve the url from the $payment->getLinks() method
Update Payment Sample
This sample code demonstrate how you can update a Payment resources you've created using the Payments API.
NOTE
Note that it can only be updated before the execute is done. Once, the payment is executed it is not possible to udpate that. Docs: https://developer.paypal.com/webapps/developer/docs/api/#update-a-payment-resource API used: PATCH /v1/payments/payment/