Update the Payment Selection Page

When a payment selection causes changes to the displayed fields in your payment flow, you might PATCH the payment and reload the payment selection page.

This example demonstrates how to issue a patch request.

curl -v -X PATCH https://api.sandbox.paypal.com/v1/payments/payment/Payment-Id
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer Access-Token' \
  -d '{
  {
    "op": "replace",
    "path": "/transactions/0/amount",
    "value": {
      "total": "25.00",
      "currency": " BRL ",
      "details": {
        "subtotal": "20.00",
        "shipping": "5.00"
      }
    }
  }, {
    "op": "add",
    "path": "/transactions/0/item_list/shipping_address",
    "value": {
      "recipient_name": "Max Santos",
      "line1": "Greg?rio Rolim de Oliveira, 42",
      "city": "Votorantim",
      "postal_code": "18117-134",
      "country_code": "BR"
    }
  }
}'

If the call succeeds, the response returns the HTTP 204 No Content status code.

Next

Feedback