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

DeleteExternalRefund() public static method

Deletes an external refund, by invoice ID and transaction ID.
public static DeleteExternalRefund ( 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 the refund transaction.
transactionId string The ID of the refund transaction to delete.
return void
        public static void DeleteExternalRefund(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}/refund-records/{1}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoiceId, transactionId });
            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.DELETE, resourcePath);
        }