PayPal.Api.Invoice.DeleteExternalPayment C# (CSharp) Method

DeleteExternalPayment() public static method

Deletes an external payment, by invoice ID and transaction ID.
public static DeleteExternalPayment ( APIContext apiContext, string invoiceId, string transactionId ) : void
apiContext APIContext APIContext used for the API call.
invoiceId string The ID of the invoice from which to delete a payment transaction.
transactionId string The ID of the payment transaction to delete.
return void
        public static void DeleteExternalPayment(APIContext apiContext, string invoiceId, string transactionId)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(invoiceId, "invoiceId");
            ArgumentValidator.Validate(transactionId, "transactionId");

            // Configure and send the request
            apiContext.MaskRequestId = true;
            var pattern = "v1/invoicing/invoices/{0}/payment-records/{1}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoiceId, transactionId });
            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.DELETE, resourcePath);
        }