lib/tessitura_rest/web/session.rb in tessitura_rest-0.3.15 vs lib/tessitura_rest/web/session.rb in tessitura_rest-0.4.0

- old
+ new

@@ -1,64 +1,64 @@ module Session def get_session(key, options={}) - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) response = self.class.get(base_api_endpoint("Web/Session/#{key}"), options) JSON.parse(response.body) end def create_session(ip, options={}) parameters = { 'IpAddress': ip, 'Organization': 'Tessitura Web' } - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters) response = self.class.post(base_api_endpoint('Web/Session'), options) JSON.parse(response.body) end def get_expiration(key, options={}) - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) response = self.class.get(base_api_endpoint("Web/Session/#{key}/Expiration"), options) JSON.parse(response.body) end def set_expiration(key, expiration, options={}) parameters = { 'Expiration': expiration } - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters) response = self.class.put(base_api_endpoint("Web/Session/#{key}/Expiration"), options) JSON.parse(response.body) end def load_existing_order(key, order_id, options={}) - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) self.class.post(base_api_endpoint("Web/Session/#{key}/LoadOrder/#{order_id}"), options) end def get_promotion(key, code, options={}) parameters = { 'PromoCode': code } - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters) response = self.class.post(base_api_endpoint("Web/Session/#{key}/PromoCode"), options) JSON.parse(response.body) end def get_promotion_code(key, code, options={}) parameters = { 'PromoCodeString': code } - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters) response = self.class.post(base_api_endpoint("Web/Session/#{key}/PromoCode"), options) JSON.parse(response.body) end @@ -67,10 +67,10 @@ { 'TemplateFormatId': template_id, 'LoginTypeId': login_type, 'EmailAddress': email } - options.merge!({:basic_auth => @auth}) + options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters) self.class.post(base_api_endpoint("/Web/Session/#{key}/Login/SendCredentials"), options) end end