public Option Retrieve(OptionRetrieveServiceOptions options)
        {
            String  Result       = TwoCheckoutUtil.Request("api/products/detail_option", "GET", "admin", options);
            Options OptionResult = TwoCheckoutUtil.MapToObject <Options>(Result);

            return(OptionResult.option[0]);
        }
        public Authorization Authorize(ChargeAuthorizeServiceOptions options)
        {
            options.privateKey = TwoCheckoutConfig.PrivateKey;
            options.sellerId   = TwoCheckoutConfig.SellerID;
            string Result = TwoCheckoutUtil.Request("checkout/api/1/" + TwoCheckoutConfig.SellerID + "/rs/authService", "POST", "payment", options);

            return(TwoCheckoutUtil.MapToObject <Authorization>(Result, "response"));
        }
Beispiel #3
0
 public TwoCheckoutResponse Refund(SaleRefundServiceOptions options)
 {
     String Result = null;
     if (options.lineitem_id != null)
     {
         Result = TwoCheckoutUtil.Request("api/sales/refund_lineitem", "POST", "admin", options);
     }
     else
     {
         Result = TwoCheckoutUtil.Request("api/sales/refund_invoice", "POST", "admin", options);
     }
     return TwoCheckoutUtil.MapToObject<TwoCheckoutResponse>(Result);
 }
        public static string StopActiveLineitems(Dictionary <string, string> active)
        {
            string stoppedLineitems        = null;
            SaleStopServiceOptions options = new SaleStopServiceOptions();

            foreach (var entry in active)
            {
                options.lineitem_id = Convert.ToInt64(entry.Value);
                try
                {
                    TwoCheckoutUtil.Request("api/sales/stop_lineitem_recurring", "POST", "admin", options);
                    stoppedLineitems += "," + entry.Value; //log the stopped lineitem in response mesage
                }
                catch (TwoCheckoutException)
                {
                    return("{ 'response_code': 'NOTICE', 'response_message': 'Linetiem " + entry.Value + " could not be stopped.' }");
                }
            }
            stoppedLineitems = stoppedLineitems.Remove(0, 1); //drop the leading comma
            return("{ 'response_code': 'OK', 'response_message': '" + stoppedLineitems + "' }");
        }
Beispiel #5
0
 public TwoCheckoutResponse Stop(SaleStopServiceOptions options)
 {
     String Result = null;
     if (options.sale_id != null)
     {
         Result = TwoCheckoutUtil.Request("api/sales/detail_sale", "GET", "admin", options);
         Dictionary<string, string> Active = TwoCheckoutUtil.Active(Result);
         if (Active.ContainsKey("lineitem_id0"))
         {
             Result = TwoCheckoutUtil.StopActiveLineitems(Active);
         }
         else
         {
             Result = "{ 'response_code': 'NOTICE', 'response_message': " + "'No active recurring lineitems.'" + " }";
         }
     }
     else
     {
         Result = TwoCheckoutUtil.Request("api/sales/stop_lineitem_recurring", "POST", "admin", options);
     }
     return TwoCheckoutUtil.MapToObject<TwoCheckoutResponse>(Result);
 }
Beispiel #6
0
        public CouponList List()
        {
            String Result = TwoCheckoutUtil.Request("api/products/list_coupons", "GET", "admin");

            return(TwoCheckoutUtil.MapToObject <CouponList>(Result));
        }
        public List <Payment> ListPayments()
        {
            string Result = TwoCheckoutUtil.Request("api/acct/list_payments", "GET", "admin");

            return(TwoCheckoutUtil.MapToObject <List <Payment> >(Result, "payments"));
        }
        public Payment PendingPayment()
        {
            string Result = TwoCheckoutUtil.Request("api/acct/detail_pending_payment", "GET", "admin");

            return(TwoCheckoutUtil.MapToObject <Payment>(Result, "payment"));
        }
Beispiel #9
0
        public TwoCheckoutResponse Ship(SaleShipServiceOptions options)
        {
            string Result = TwoCheckoutUtil.Request("api/sales/mark_shipped", "POST", "admin", options);

            return(TwoCheckoutUtil.MapToObject <TwoCheckoutResponse>(Result));
        }
Beispiel #10
0
        public Sale Retrieve(SaleRetrieveServiceOptions options)
        {
            string Result = TwoCheckoutUtil.Request("api/sales/detail_sale", "GET", "admin", options);

            return(TwoCheckoutUtil.MapToObject <Sale>(Result, "sale"));
        }
Beispiel #11
0
        public SaleList List(SaleListServiceOptions options = null)
        {
            string Result = TwoCheckoutUtil.Request("api/sales/list_sales", "GET", "admin", options);

            return(TwoCheckoutUtil.MapToObject <SaleList>(Result));
        }
Beispiel #12
0
        public TwoCheckoutResponse Comment(SaleCommentServiceOptions options)
        {
            string Result = TwoCheckoutUtil.Request("api/sales/create_comment", "POST", "admin", options);

            return(TwoCheckoutUtil.MapToObject <TwoCheckoutResponse>(Result));
        }
Beispiel #13
0
        public TwoCheckoutResponse Reauth(SaleReauthServiceOptions options)
        {
            String Result = TwoCheckoutUtil.Request("api/sales/reauth", "POST", "admin", options);

            return(TwoCheckoutUtil.MapToObject <TwoCheckoutResponse>(Result));
        }
        public Company CompanyInfo()
        {
            string Result = TwoCheckoutUtil.Request("api/acct/detail_company_info", "GET", "admin");

            return(TwoCheckoutUtil.MapToObject <Company>(Result, "vendor_company_info"));
        }
Beispiel #15
0
        public TwoCheckoutResponse Delete(CouponDeleteServiceOptions options = null)
        {
            String Result = TwoCheckoutUtil.Request("api/products/delete_coupon", "POST", "admin", options);

            return(TwoCheckoutUtil.MapToObject <TwoCheckoutResponse>(Result));
        }
        public TwoCheckoutResponse Create(OptionCreateServiceOptions options)
        {
            String Result = TwoCheckoutUtil.Request("api/products/create_option", "POST", "admin", options);

            return(TwoCheckoutUtil.MapToObject <TwoCheckoutResponse>(Result));
        }
        public OptionList List(OptionListServiceOptions options = null)
        {
            String Result = TwoCheckoutUtil.Request("api/products/list_options", "GET", "admin", options);

            return(TwoCheckoutUtil.MapToObject <OptionList>(Result));
        }
Beispiel #18
0
        public Product Retrieve(ProductRetrieveServiceOptions options)
        {
            string Result = TwoCheckoutUtil.Request("api/products/detail_product", "GET", "admin", options);

            return(TwoCheckoutUtil.MapToObject <Product>(Result, "product"));
        }
Beispiel #19
0
        public TwoCheckoutResponse Update(ProductUpdateServiceOptions options = null)
        {
            string Result = TwoCheckoutUtil.Request("api/products/update_product", "POST", "admin", options);

            return(TwoCheckoutUtil.MapToObject <TwoCheckoutResponse>(Result));
        }
Beispiel #20
0
        public Coupon Retrieve(CouponRetrieveServiceOptions options)
        {
            String Result = TwoCheckoutUtil.Request("api/products/detail_coupon", "GET", "admin", options);

            return(TwoCheckoutUtil.MapToObject <Coupon>(Result, "coupon"));
        }
Beispiel #21
0
        public Contact ContactInfo()
        {
            String Result = TwoCheckoutUtil.Request("api/acct/detail_contact_info", "GET", "admin");

            return(TwoCheckoutUtil.MapToObject <Contact>(Result, "vendor_contact_info"));
        }