当前位置: 首页>>代码示例>>C#>>正文


C# PatchRequest.ConvertToJson方法代码示例

本文整理汇总了C#中PatchRequest.ConvertToJson方法的典型用法代码示例。如果您正苦于以下问题:C# PatchRequest.ConvertToJson方法的具体用法?C# PatchRequest.ConvertToJson怎么用?C# PatchRequest.ConvertToJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PatchRequest的用法示例。


在下文中一共展示了PatchRequest.ConvertToJson方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        /// <summary>
        /// Partially update the Payment resource for the given identifier
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="paymentId">ID of the payment to update.</param>
        /// <param name="patchRequest">PatchRequest</param>
        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());
        }
开发者ID:paypal,项目名称:PayPal-NET-SDK,代码行数:18,代码来源:Payment.cs

示例2: Update

        /// <summary>
        /// Updates the Webhook identified by webhook_id for the application associated with access token.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="webhookId">ID of the webhook to be updated.</param>
        /// <param name="patchRequest">PatchRequest</param>
        /// <returns>Webhook</returns>
        public static Webhook Update(APIContext apiContext, string webhookId, PatchRequest patchRequest)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(webhookId, "webhookId");
            ArgumentValidator.Validate(patchRequest, "patchRequest");

            // Configure and send the request
            var pattern = "v1/notifications/webhooks/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { webhookId });
            return PayPalResource.ConfigureAndExecute<Webhook>(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
        }
开发者ID:paypal,项目名称:PayPal-NET-SDK,代码行数:19,代码来源:Webhook.cs

示例3: Update

        /// <summary>
        /// Update information in a previously saved card. Only the modified fields need to be passed in the request.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="patchRequest">PatchRequest</param>
        /// <returns>CreditCard</returns>
        public CreditCard Update(APIContext apiContext, PatchRequest patchRequest)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(this.id, "Id");
            ArgumentValidator.Validate(patchRequest, "patchRequest");

            // Configure and send the request
            var pattern = "v1/vault/credit-cards/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { this.id });
            return PayPalResource.ConfigureAndExecute<CreditCard>(apiContext, HttpMethod.PATCH, resourcePath, patchRequest.ConvertToJson());
        }
开发者ID:paypal,项目名称:PayPal-NET-SDK,代码行数:18,代码来源:CreditCard.cs


注:本文中的PatchRequest.ConvertToJson方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。