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

Update() public static method

Full update of the invoice resource for the given identifier.
public static Update ( APIContext apiContext, Invoice invoice, bool notifyMerchant = true ) : Invoice
apiContext APIContext APIContext used for the API call.
invoice Invoice Invoice object to update.
notifyMerchant bool Specifies if the invoice update notification is needed for merchant
return Invoice
        public static Invoice Update(APIContext apiContext, Invoice invoice, bool notifyMerchant = true)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(invoice, "invoice");

            var queryParameters = new QueryParameters();
            queryParameters["notify_merchant"] = notifyMerchant.ToString();

            // Configure and send the request
            var pattern = "v1/invoicing/invoices/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { invoice.id }) + queryParameters.ToUrlFormattedString();
            return PayPalResource.ConfigureAndExecute<Invoice>(apiContext, HttpMethod.PUT, resourcePath, invoice.ConvertToJson());
        }

Same methods

Invoice::Update ( APIContext apiContext, bool notifyMerchant = true ) : Invoice

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Fully updates an invoice, by ID. In the JSON request body, include a complete `invoice` object. This call does not support partial updates.
 /// </summary>
 /// <param name="apiContext">APIContext used for the API call.</param>
 /// <param name="notifyMerchant">Indicates whether to send the invoice update notification to the merchant. Default is `true`.</param>
 /// <returns>Invoice</returns>
 public Invoice Update(APIContext apiContext, bool notifyMerchant = true)
 {
     return(Invoice.Update(apiContext, this, notifyMerchant));
 }