示例#1
0
        public KnetikApiResponse CartShippingAddress(
            ShippingAddress address,
            Action<KnetikApiResponse> cb = null
        )
        {
            JSONObject j = new JSONObject (JSONObject.Type.OBJECT);
            j.AddField ("first_name", address.FirstName);
            j.AddField ("last_name", address.FirstName);
            j.AddField ("address_line_1", address.AddressLine1);
            j.AddField ("address_line_1", address.AddressLine2);
            j.AddField ("city", address.City);
            j.AddField ("postal_state", address.PostalState);
            j.AddField ("zip", address.Zip);
            j.AddField ("country", address.Country);
            j.AddField ("email", address.Email);
            String body = j.Print ();

            KnetikRequest req = CreateRequest(CartShippingAddressEndpoint, body);

            KnetikApiResponse response = new KnetikApiResponse(this, req, cb);
            return  response;
        }
示例#2
0
        public KnetikApiResponse CartShippingAddress(string cartNumber,
            ShippingAddress address,
            Action<KnetikApiResponse> cb = null
        )
        {
            JSONObject j = new JSONObject (JSONObject.Type.OBJECT);
            j.AddField ("name_prefix", address.PrefixName);
            j.AddField ("first_name", address.FirstName);
            j.AddField ("last_name", address.FirstName);
            j.AddField ("shipping_address_line1", address.AddressLine1);
            j.AddField ("shipping_address_line2", address.AddressLine2);
            j.AddField ("city", address.City);
            j.AddField ("postal_state_id", address.PostalState);
            j.AddField ("zip", address.Zip);
            j.AddField ("country", address.Country);
            j.AddField ("country_id", address.Country_id);
            j.AddField ("email", address.Email);
            j.AddField ("order_notes", address.OrderNotes);

            String body = j.Print ();
            StringBuilder cartShippingAddressEndPoint = new StringBuilder();
            cartShippingAddressEndPoint.AppendFormat(CartModifyShippingAddressEndpoint,cartNumber);
            KnetikRequest req = CreateRequest(cartShippingAddressEndPoint.ToString(), body,"PUT");

            KnetikApiResponse response = new KnetikApiResponse(this, req, cb);
            return  response;
        }