示例#1
0
        public static IRestResponse ProductGet(string productId)
        {
            var client  = RestClientV1.client("/v1/catalogs/products/" + productId);
            var request = new RestRequest(Method.GET);

            request.AddHeader("Content-type", "application/json");
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#2
0
        public static IRestResponse ProductsList(int pageSize, int page, bool totalRequired)
        {
            var client  = RestClientV1.client($"/v1/catalogs/products?page_size={pageSize}&page={page}&total_required={totalRequired}");
            var request = new RestRequest(Method.GET);

            request.AddHeader("Content-type", "application/json");
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#3
0
        public static IRestResponse SubscriptionActivate(string subscriptionId)
        {
            var client  = RestClientV1.client("/v1/billing/subscriptions/" + subscriptionId + "/activate");
            var request = new RestRequest(Method.POST);

            request.AddHeader("Content-Type", "application/json");
            IRestResponse response = client.Execute(request);

            return(response);
        }
        public static IRestResponse PlanGet(string planId)
        {
            var client  = RestClientV1.client("/v1/billing/plans/" + planId);
            var request = new RestRequest(Method.GET);

            request.AddHeader("Content-Type", "application/json");
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#5
0
        public static IRestResponse ProductPatch(string productId, List <PatchObject> patchObjects)
        {
            var client  = RestClientV1.client("/v1/catalogs/products/" + productId);
            var request = new RestRequest(Method.PATCH);

            request.AddHeader("Content-type", "application/json");
            request.AddJsonBody(patchObjects);
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#6
0
        public static IRestResponse SubscriptionTransactionsList(string subscriptionId, string startTime, string endTime)
        {
            var client = RestClientV1.client("/v1/billing/subscriptions/" + subscriptionId +
                                             "/transactions?start_time=" + startTime + "&end_time=" + endTime);
            var request = new RestRequest(Method.GET);

            request.AddHeader("Content-Type", "application/json");
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#7
0
        public static IRestResponse SubscriptionSuspend(string subscriptionId, CancelSubscription suspend)
        {
            var client  = RestClientV1.client("/v1/billing/subscriptions/" + subscriptionId + "/suspend");
            var request = new RestRequest(Method.POST);

            request.AddHeader("Content-Type", "application/json");
            request.AddJsonBody(suspend);
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#8
0
        public static IRestResponse SubscriptionPatch(string subscriptionId, List <PatchObject> patchObjects)
        {
            var client  = RestClientV1.client("/v1/billing/subscriptions/" + subscriptionId);
            var request = new RestRequest(Method.PATCH);

            request.AddHeader("Content-type", "application/json");
            request.AddJsonBody(patchObjects);
            IRestResponse response = client.Execute(request);

            return(response);
        }
        public static IRestResponse PlanPricingUpdate(string planId, List <PricingScheme> pricingSchemes)
        {
            var client  = RestClientV1.client("/v1/billing/plans/" + planId + "/update-pricing-schemes");
            var request = new RestRequest(Method.POST);

            request.AddHeader("Content-Type", "application/json");
            request.AddJsonBody(pricingSchemes);
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#10
0
        public static IRestResponse ProductCreate(Product product, string prefer = "representation", string paypalRequestId = "PRODUCT-my-testing01")
        {
            var client  = RestClientV1.client("/v1/catalogs/products");
            var request = new RestRequest(Method.POST);

            request.AddHeader("Content-type", "application/json");
            request.AddHeader("Prefer", "return=" + prefer);
            request.AddHeader("PayPal-Request-Id", paypalRequestId);
            request.AddJsonBody(product);
            IRestResponse response = client.Execute(request);

            return(response);
        }
示例#11
0
        public static IRestResponse SubscriptionCreate(Subscription subscription, string prefer = "representation", string paypalRequestId = "SUBSCRIPTION-my-testing01")
        {
            var client  = RestClientV1.client("/v1/billing/subscriptions");
            var request = new RestRequest(Method.POST);

            request.AddHeader("Content-type", "application/json");
            request.AddHeader("Prefer", "return=" + prefer);
            request.AddHeader("PayPal-Request-Id", paypalRequestId);
            request.AddJsonBody(subscription);
            IRestResponse response = client.Execute(request);

            return(response);
        }