PayPal.Api.Payment.Update C# (CSharp) Method

Update() public static method

Partially update the Payment resource for the given identifier
public static Update ( APIContext apiContext, string paymentId, PatchRequest patchRequest ) : void
apiContext APIContext APIContext used for the API call.
paymentId string ID of the payment to update.
patchRequest PatchRequest PatchRequest
return void
        public static void Update(APIContext apiContext, string paymentId, PatchRequest patchRequest)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(paymentId, "paymentId");
            ArgumentValidator.Validate(patchRequest, "patchRequest");

            // Configure and send the request
            var pattern = "v1/payments/payment/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { paymentId });
            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
        }

Same methods

Payment::Update ( APIContext apiContext, PatchRequest patchRequest ) : void

Usage Example

Example #1
0
 /// <summary>
 /// Partially update the Payment resource for the given identifier
 /// </summary>
 /// <param name="apiContext">APIContext used for the API call.</param>
 /// <param name="patchRequest">PatchRequest</param>
 public void Update(APIContext apiContext, PatchRequest patchRequest)
 {
     Payment.Update(apiContext, this.id, patchRequest);
 }