예제 #1
0
        /// <summary>
        /// Create a web experience profile by passing the name of the profile and other profile details in the request JSON to the request URI.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="webProfile">WebProfile object to be created as a PayPal resource.</param>
        /// <returns>CreateProfileResponse</returns>
        public static CreateProfileResponse Create(APIContext apiContext, WebProfile webProfile)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);

            // Configure and send the request
            var resourcePath = "v1/payment-experience/web-profiles";
            return PayPalResource.ConfigureAndExecute<CreateProfileResponse>(apiContext, HttpMethod.POST, resourcePath, webProfile.ConvertToJson());
        }
        /// <summary>
        /// Create a web experience profile by passing the name of the profile and other profile details in the request JSON to the request URI.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="webProfile">WebProfile object to be created as a PayPal resource.</param>
        /// <returns>CreateProfileResponse</returns>
        public static CreateProfileResponse Create(APIContext apiContext, WebProfile webProfile)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);

            // Configure and send the request
            var resourcePath = "v1/payment-experience/web-profiles";

            return(PayPalResource.ConfigureAndExecute <CreateProfileResponse>(apiContext, HttpMethod.POST, resourcePath, webProfile.ConvertToJson()));
        }
        /// <summary>
        /// Update a web experience profile by passing the ID of the profile to the request URI. In addition, pass the profile details in the request JSON. If your request does not include values for all profile detail fields, the previously set values for the omitted fields are removed by this operation.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="profile">WebProfile resource to update.</param>
        public static void Update(APIContext apiContext, WebProfile profile)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(profile, "profile");

            // Configure and send the request
            var pattern      = "v1/payment-experience/web-profiles/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { profile.id });

            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.PUT, resourcePath, profile.ConvertToJson());
        }
예제 #4
0
        /// <summary>
        /// Update a web experience profile by passing the ID of the profile to the request URI. In addition, pass the profile details in the request JSON. If your request does not include values for all profile detail fields, the previously set values for the omitted fields are removed by this operation.
        /// </summary>
        /// <param name="apiContext">APIContext used for the API call.</param>
        /// <param name="profile">WebProfile resource to update.</param>
        public static void Update(APIContext apiContext, WebProfile profile)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);
            ArgumentValidator.Validate(profile, "profile");

            // Configure and send the request
            var pattern = "v1/payment-experience/web-profiles/{0}";
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { profile.id });
            PayPalResource.ConfigureAndExecute(apiContext, HttpMethod.PUT, resourcePath, profile.ConvertToJson());
        }