module Cart def web_cart_text(session_key, options={}) options.merge!({:basic_auth => @auth}) self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Messages?messageTypes=#{ENV['WEB_CART_TEXT']}&savedCart=false"), options) end def order_confirm_text(session_key, options={}) options.merge!({:basic_auth => @auth}) self.class.get(base_api_endpoint("Web/Cart/#{session_key}?messageTypes=#{ENV['ORDER_CONFIRM_TEXT']}&savedCart=true"), options) end def change_mode_of_sale(session_key, code, options={}) parameters = { 'ModeOfSaleId': code } options.merge!({:basic_auth => @auth}) options.merge!(:body => parameters) self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Properties"), options) end def add_gift_certificate(session_key, amount, name, notes, gift_certificate_type, options={}) parameters = { 'Amount': amount, 'PaymentMethodId': gift_certificate_type, 'Notes': notes, 'Name': name } options.merge!({:basic_auth => @auth}) options.merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/GiftCertificates"), options) end def remove_gift_certificate(session_key, gift_certificate_number, options={}) options.merge!({:basic_auth => @auth}) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/GiftCertificates/#{gift_certificate_number}"), options) end def add_contribution(session_key, amount, fund, membership_level, renew=nil, upgrade=nil, options={}) parameters = { 'Amount': amount, 'FundId': fund, 'Upgrade': upgrade, 'Renew': renew, 'MembershipLevelId': membership_level } options.merge!({:basic_auth => @auth}) options.merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Contributions"), options) end def remove_contribution(session_key, line_item_id, options={}) options.merge!({:basic_auth => @auth}) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Contributions/#{line_item_id}"), options) end def add_on_account(session_key, amount, payment_method_id, options={}) parameters = { 'Amount': amount, "PaymentMethodId": payment_method_id } options.merge!({:basic_auth => @auth}) options.merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/OnAccount"), options) end def remove_on_account(session_key, payment_id, options={}) options.merge!({:basic_auth => @auth}) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/OnAccount/#{payment_id}"), options) end end