Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow credentials to be modified per request

  • Loading branch information...
commit ed2a24b6112f64580136206f4b39eb7acca6836a 1 parent 658d217
Ryan Closner authored
7 lib/agent_cooper/finder.rb
View
@@ -4,13 +4,16 @@ class Finder < Request
VERSION = '1.9.0'
base_uri 'svcs.ebay.com'
- default_params 'SECURITY-APPNAME' => Config.app_id,
- 'SECURITY-VERSION' => VERSION,
+ default_params 'SECURITY-VERSION' => VERSION,
'RESPONSE-DATA-FORMAT' => ENCODING,
'REST-PAYLOAD' => ''
protected
+ def credentials
+ { 'SECURITY-APPNAME' => Config.app_id }
+ end
+
def path
'/services/search/FindingService/v1'
end
4 lib/agent_cooper/merchandiser.rb
View
@@ -13,6 +13,10 @@ class Merchandiser < Request
protected
+ def credentials
+ { 'CONSUMER-ID' => Config.app_id }
+ end
+
def path
'/MerchandisingService'
end
2  lib/agent_cooper/request.rb
View
@@ -23,7 +23,7 @@ def reset!
end
def get
- r = self.class.get(path, :query => options)
+ r = self.class.get(path, :query => options.merge(credentials))
Response.new(r)
end
end
4 lib/agent_cooper/shopper.rb
View
@@ -11,6 +11,10 @@ class Shopper < Request
protected
+ def credentials
+ { 'APPID' => Config.app_id }
+ end
+
def path
'/shopping'
end
Please sign in to comment.
Something went wrong with that request. Please try again.