From e8e29fc2bd11593c54c8f448d795ce5376229753 Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Mon, 14 Oct 2013 18:57:01 +0200 Subject: [PATCH 01/18] Upgrade to rails4 --- zooz.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zooz.gemspec b/zooz.gemspec index 2a65fc4..ddfaca5 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -9,6 +9,6 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE", "*.md"] s.require_path = 'lib' s.homepage = 'https://github.com/Miniand/zooz-ruby' - s.add_dependency('activesupport', '~> 3.2.0') + s.add_dependency('activesupport', '~> 4.0.0') s.add_dependency('httparty', '~> 0.8.0') end From 3ffa92a94771fa6a540bea1fb50036571d80858b Mon Sep 17 00:00:00 2001 From: awayo Date: Mon, 14 Oct 2013 20:51:54 +0200 Subject: [PATCH 02/18] Added commit method from Extended Server API --- lib/zooz.rb | 1 + lib/zooz/request.rb | 16 +++++++++++--- lib/zooz/request/commit.rb | 42 +++++++++++++++++++++++++++++++++++++ lib/zooz/response.rb | 9 ++++++-- lib/zooz/response/commit.rb | 15 +++++++++++++ zooz.gemspec | 3 ++- 6 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 lib/zooz/request/commit.rb create mode 100644 lib/zooz/response/commit.rb diff --git a/lib/zooz.rb b/lib/zooz.rb index b027e81..1ca7fa7 100644 --- a/lib/zooz.rb +++ b/lib/zooz.rb @@ -1,3 +1,4 @@ # Require all requests require 'zooz/request/open' require 'zooz/request/verify' +require 'zooz/request/commit' diff --git a/lib/zooz/request.rb b/lib/zooz/request.rb index 097df84..9ca9462 100644 --- a/lib/zooz/request.rb +++ b/lib/zooz/request.rb @@ -3,7 +3,7 @@ # The ZooZ Request class formats and sends requests to the ZooZ API. module Zooz class Request - attr_accessor :sandbox, :unique_id, :app_key, :response_type, :cmd + attr_accessor :sandbox, :developer_id, :unique_id, :app_key, :response_type, :cmd attr_reader :errors, :params def initialize @@ -44,7 +44,16 @@ def request 'ZooZ-Unique-ID' => @unique_id, 'ZooZ-App-Key' => @app_key, 'ZooZ-Response-Type' => @response_type, - }) + }) if @response_type.eql?('NVP') + + http_response = HTTParty.post(url, :format => :plain, + :headers => { + 'ZooZDeveloperId' => @developer_id, + 'ZooZServerAPIKey' => @app_key, + 'cmd' => @cmd, + 'ver' => @ver, + 'transactionID' => @transaction_id + }) if @response_type.eql?('JSON') response = Response.new response.request = self response.http_response = http_response @@ -58,7 +67,8 @@ def request # Whether the request object is valid for requesting. def valid? @errors = [] - @errors << 'unique_id is required' if @unique_id.nil? + @errors << 'unique_id is required' if @unique_id.nil? && @response_type.eql?('NVP') + @errors << 'developer_id is required' if @developer_id.nil? && @response_type.eql?('JSON') @errors << 'app_key is required' if @app_key.nil? @errors << 'cmd is required' if @cmd.nil? @errors << 'response_type is required' if @response_type.nil? diff --git a/lib/zooz/request/commit.rb b/lib/zooz/request/commit.rb new file mode 100644 index 0000000..1e5dc30 --- /dev/null +++ b/lib/zooz/request/commit.rb @@ -0,0 +1,42 @@ +require 'zooz/request' +require 'zooz/response/open' +require 'active_support/core_ext/module/delegation' + +module Zooz + class Request + class Commit + attr_accessor :transaction_id, :requestor + attr_reader :errors + delegate :sandbox, :sandbox=, :unique_id, :unique_id=, :app_key, + :app_key=, :response_type, :response_type=, :cmd, :cmd=, :is_sandbox?, + :to => :requestor + + def initialize + @errors = [] + @requestor = Request.new + @requestor.cmd = 'commitTransaction' + end + + def request + return false unless valid? + @requestor.set_param('ver', '1.0.6') + @requestor.set_param('transactionID', @transaction_id) + open_response = Response::Open.new + open_response.request = self + open_response.response = @requestor.request + unless open_response.response + @errors += @requestor.errors + return false + end + open_response + end + + def valid? + @errors = [] + @errors << 'transaction_id is required' if @transaction_id.nil? + @errors += @requestor.errors unless @requestor.valid? + @errors.empty? + end + end + end +end diff --git a/lib/zooz/response.rb b/lib/zooz/response.rb index 7859c78..470dd7c 100644 --- a/lib/zooz/response.rb +++ b/lib/zooz/response.rb @@ -5,7 +5,7 @@ # and reports on success and errors. module Zooz class Response - attr_accessor :http_response, :request + attr_accessor :http_response, :request, :json_response attr_reader :errors delegate :body, :code, :message, :headers, :to => :http_response, :prefix => :http @@ -26,9 +26,14 @@ def parsed_response CGI::parse(http_body.strip) end + def parsed_json_response + @json_response = JSON.parse(http_body) + end + # Get the ZooZ status code, 0 for success. def status_code - get_parsed_singular('statusCode') + get_parsed_singular('statusCode') if @json_response.blank? + @json_response['ResponseStatus'] unless @json_response.blank? end # Get the ZooZ error message, returned when status_code is not 0. diff --git a/lib/zooz/response/commit.rb b/lib/zooz/response/commit.rb new file mode 100644 index 0000000..16dff8f --- /dev/null +++ b/lib/zooz/response/commit.rb @@ -0,0 +1,15 @@ +require 'zooz/response' +require 'active_support/core_ext/module/delegation' + +module Zooz + class Response + class Commit + attr_accessor :request, :response + delegate :success?, :errors, :parsed_json_response, :get_parsed_singular, + :to => :response + delegate :is_sandbox?, :unique_id, :app_key, :transaction_id, + :to => :request + end + end +end + diff --git a/zooz.gemspec b/zooz.gemspec index ddfaca5..574f987 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.2' + s.version = '1.0.3' s.date = '2012-08-23' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" @@ -11,4 +11,5 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/Miniand/zooz-ruby' s.add_dependency('activesupport', '~> 4.0.0') s.add_dependency('httparty', '~> 0.8.0') + s.add_dependency('json') end From fd260d22282e6cd00a9230d5f022f09850df1122 Mon Sep 17 00:00:00 2001 From: awayo Date: Tue, 15 Oct 2013 12:04:55 +0200 Subject: [PATCH 03/18] =?UTF-8?q?Bug=20fix,=20response=20don't=20return=20?= =?UTF-8?q?statusCode=C3=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/zooz/response.rb | 7 +++++-- zooz.gemspec | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/zooz/response.rb b/lib/zooz/response.rb index 470dd7c..8433032 100644 --- a/lib/zooz/response.rb +++ b/lib/zooz/response.rb @@ -32,8 +32,11 @@ def parsed_json_response # Get the ZooZ status code, 0 for success. def status_code - get_parsed_singular('statusCode') if @json_response.blank? - @json_response['ResponseStatus'] unless @json_response.blank? + if @json_response.blank? + get_parsed_singular('statusCode') + else + @json_response['ResponseStatus'] + end end # Get the ZooZ error message, returned when status_code is not 0. diff --git a/zooz.gemspec b/zooz.gemspec index 574f987..fc4d6d3 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.3' + s.version = '1.0.4' s.date = '2012-08-23' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From 705c59cac635cbff43c4c25731e55fc29c25db39 Mon Sep 17 00:00:00 2001 From: awayo Date: Tue, 15 Oct 2013 20:08:44 +0200 Subject: [PATCH 04/18] Bugfixes in commit request --- lib/zooz/request.rb | 40 ++++++++++++++++++++++++-------------- lib/zooz/request/commit.rb | 12 ++++++------ lib/zooz/response.rb | 2 +- zooz.gemspec | 2 +- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/lib/zooz/request.rb b/lib/zooz/request.rb index 9ca9462..b4c55cf 100644 --- a/lib/zooz/request.rb +++ b/lib/zooz/request.rb @@ -11,6 +11,7 @@ def initialize @errors = [] @response_type = 'NVP' @sandbox = false + @headers = {} end # Set a request parameter. @@ -23,6 +24,10 @@ def get_param @params[name] end + def set_header name, value + @headers[name]= value + end + # Whether the request will be sent to sandbox. def is_sandbox? @sandbox == true @@ -31,29 +36,34 @@ def is_sandbox? # Get the URL of the API, based on whether in sandbox mode or not. def url (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + - '/mobile/SecuredWebServlet' + '/mobile/SecuredWebServlet' if @response_type.eql?('NVP') + (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + + '/mobile/ExtendedServerAPI' if @response_type.eql?('JSON') end # Send a request to the server, returns a Zooz::Response object or false. # If returning false, the @errors attribute is populated. def request + url1 = url return false unless valid? http_response = HTTParty.post(url, :format => :plain, - :query => @params.merge({ :cmd => @cmd }), - :headers => { - 'ZooZ-Unique-ID' => @unique_id, - 'ZooZ-App-Key' => @app_key, - 'ZooZ-Response-Type' => @response_type, - }) if @response_type.eql?('NVP') - - http_response = HTTParty.post(url, :format => :plain, + :query => @params.merge({ :cmd => @cmd }), :headers => { - 'ZooZDeveloperId' => @developer_id, - 'ZooZServerAPIKey' => @app_key, - 'cmd' => @cmd, - 'ver' => @ver, - 'transactionID' => @transaction_id - }) if @response_type.eql?('JSON') + 'ZooZ-Unique-ID' => @unique_id, + 'ZooZ-App-Key' => @app_key, + 'ZooZ-Response-Type' => @response_type, + }) if @response_type.eql?('NVP') + + if @response_type.eql?('JSON') + headers = { + 'ZooZDeveloperId' => @developer_id, + 'ZooZServerAPIKey' => @app_key, + 'cmd' => @cmd, + } + + http_response = HTTParty.post(url, :format => :plain, + :headers => headers.merge(@headers)) + end response = Response.new response.request = self response.http_response = http_response diff --git a/lib/zooz/request/commit.rb b/lib/zooz/request/commit.rb index 1e5dc30..89b0e90 100644 --- a/lib/zooz/request/commit.rb +++ b/lib/zooz/request/commit.rb @@ -1,5 +1,5 @@ require 'zooz/request' -require 'zooz/response/open' +require 'zooz/response/commit' require 'active_support/core_ext/module/delegation' module Zooz @@ -8,8 +8,8 @@ class Commit attr_accessor :transaction_id, :requestor attr_reader :errors delegate :sandbox, :sandbox=, :unique_id, :unique_id=, :app_key, - :app_key=, :response_type, :response_type=, :cmd, :cmd=, :is_sandbox?, - :to => :requestor + :app_key=, :response_type, :response_type=, :cmd, :cmd=, :is_sandbox?, :developer_id, :developer_id=, + :to => :requestor def initialize @errors = [] @@ -19,9 +19,9 @@ def initialize def request return false unless valid? - @requestor.set_param('ver', '1.0.6') - @requestor.set_param('transactionID', @transaction_id) - open_response = Response::Open.new + @requestor.set_header('ver', '1.0.6') + @requestor.set_header('transactionID', @transaction_id) + open_response = Response::Commit.new open_response.request = self open_response.response = @requestor.request unless open_response.response diff --git a/lib/zooz/response.rb b/lib/zooz/response.rb index 8433032..5d51626 100644 --- a/lib/zooz/response.rb +++ b/lib/zooz/response.rb @@ -23,7 +23,7 @@ def get_parsed_singular(offset) # Get a parsed response as an object from the response text. def parsed_response - CGI::parse(http_body.strip) + CGI::parse(http_body.strip) unless http_body.nil? end def parsed_json_response diff --git a/zooz.gemspec b/zooz.gemspec index fc4d6d3..ceb84fb 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.4' + s.version = '1.0.5' s.date = '2012-08-23' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From 7a55f90a50ffa14474c3d89ef581c08d640f3ef2 Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Tue, 15 Oct 2013 22:39:51 +0200 Subject: [PATCH 05/18] Modified commit cmd --- lib/zooz/request.rb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/zooz/request.rb b/lib/zooz/request.rb index b4c55cf..0ab32f3 100644 --- a/lib/zooz/request.rb +++ b/lib/zooz/request.rb @@ -54,16 +54,15 @@ def request 'ZooZ-Response-Type' => @response_type, }) if @response_type.eql?('NVP') - if @response_type.eql?('JSON') - headers = { - 'ZooZDeveloperId' => @developer_id, - 'ZooZServerAPIKey' => @app_key, - 'cmd' => @cmd, - } + + + http_response = HTTParty.post(url, :format => :plain, + :query => @params.merge({ :cmd => @cmd }), + :headers => { + 'ZooZDeveloperId' => @developer_id, + 'ZooZServerAPIKey' => @app_key + }) if @response_type.eql?('JSON') - http_response = HTTParty.post(url, :format => :plain, - :headers => headers.merge(@headers)) - end response = Response.new response.request = self response.http_response = http_response @@ -85,4 +84,4 @@ def valid? @errors.empty? end end -end \ No newline at end of file +end From 8387503b8f3419003228cef0de359bf7a76f36c1 Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Tue, 15 Oct 2013 22:40:56 +0200 Subject: [PATCH 06/18] Modified commit cmd --- lib/zooz/request/commit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zooz/request/commit.rb b/lib/zooz/request/commit.rb index 89b0e90..b4110c9 100644 --- a/lib/zooz/request/commit.rb +++ b/lib/zooz/request/commit.rb @@ -19,8 +19,8 @@ def initialize def request return false unless valid? - @requestor.set_header('ver', '1.0.6') - @requestor.set_header('transactionID', @transaction_id) + @requestor.set_param('ver', '1.0.6') + @requestor.set_param('transactionID', @transaction_id) open_response = Response::Commit.new open_response.request = self open_response.response = @requestor.request From 78905cca99e047c2d93c3fad645b221245a7798e Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 09:15:04 +0200 Subject: [PATCH 07/18] Update version --- zooz.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zooz.gemspec b/zooz.gemspec index ceb84fb..04058fe 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.5' + s.version = '1.0.6' s.date = '2012-08-23' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From a0d55941c9bb5e2a6cdbdaf6919e551029ca7d5c Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 13:35:20 +0200 Subject: [PATCH 08/18] Bug fix: Fixed an error when called ExtendedServerAPI with XML format --- lib/zooz/request.rb | 10 +++++----- lib/zooz/response.rb | 11 ++++++++--- zooz.gemspec | 6 +++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/zooz/request.rb b/lib/zooz/request.rb index 0ab32f3..bd4f625 100644 --- a/lib/zooz/request.rb +++ b/lib/zooz/request.rb @@ -54,13 +54,13 @@ def request 'ZooZ-Response-Type' => @response_type, }) if @response_type.eql?('NVP') - - http_response = HTTParty.post(url, :format => :plain, - :query => @params.merge({ :cmd => @cmd }), - :headers => { + + http_response = HTTParty.post(url, :format => :json, + :body => @params.merge({ :cmd => @cmd }), + :headers => { 'ZooZDeveloperId' => @developer_id, - 'ZooZServerAPIKey' => @app_key + 'ZooZServerAPIKey' => CGI::escape(@app_key) }) if @response_type.eql?('JSON') response = Response.new diff --git a/lib/zooz/response.rb b/lib/zooz/response.rb index 5d51626..ddf0912 100644 --- a/lib/zooz/response.rb +++ b/lib/zooz/response.rb @@ -8,7 +8,7 @@ class Response attr_accessor :http_response, :request, :json_response attr_reader :errors delegate :body, :code, :message, :headers, :to => :http_response, - :prefix => :http + :prefix => :http delegate :is_sandbox?, :unique_id, :app_key, :to => :request def initialize @@ -27,7 +27,11 @@ def parsed_response end def parsed_json_response - @json_response = JSON.parse(http_body) + begin + @json_response = JSON.parse(http_body) + rescue UnparserError + @json_response = nil + end end # Get the ZooZ status code, 0 for success. @@ -35,7 +39,7 @@ def status_code if @json_response.blank? get_parsed_singular('statusCode') else - @json_response['ResponseStatus'] + @json_response['ResponseStatus'].to_s end end @@ -46,6 +50,7 @@ def error_message # Whether the request was successful, populates the @errors array on error. def success? + parsed_json_response @errors = [] unless http_code.to_s[0,1] == '2' @errors << "HTTP status #{http_code}: #{http_message}" diff --git a/zooz.gemspec b/zooz.gemspec index 04058fe..c222ff1 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,10 +1,10 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.6' - s.date = '2012-08-23' + s.version = '1.0.6b' + s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" - s.authors = ["Michael Alexander"] + s.authors = ["Michael Alexander", "Francisco Soto"] s.email = 'beefsack@gmail.com' s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE", "*.md"] s.require_path = 'lib' From b13b50cc8aac2a7ce82032e6a24c88fbfe100932 Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 15:40:04 +0200 Subject: [PATCH 09/18] Bug fix: Fixed an error on url method when called ExtendedServerAPI --- lib/zooz/request.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/zooz/request.rb b/lib/zooz/request.rb index bd4f625..9686d78 100644 --- a/lib/zooz/request.rb +++ b/lib/zooz/request.rb @@ -35,10 +35,13 @@ def is_sandbox? # Get the URL of the API, based on whether in sandbox mode or not. def url - (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + - '/mobile/SecuredWebServlet' if @response_type.eql?('NVP') - (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + - '/mobile/ExtendedServerAPI' if @response_type.eql?('JSON') + if @response_type.eql?('NVP') + (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + + '/mobile/SecuredWebServlet' + else + (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + + '/mobile/ExtendedServerAPI' + end end # Send a request to the server, returns a Zooz::Response object or false. From a050f7e57afec2b9470c956e28924379d92cdf00 Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 15:41:03 +0200 Subject: [PATCH 10/18] Update version --- zooz.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zooz.gemspec b/zooz.gemspec index c222ff1..2b99c8a 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.6b' + s.version = '1.0.6c' s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From 2f3e9517e300f4de88d96794c0f2077c8a957c12 Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 15:42:03 +0200 Subject: [PATCH 11/18] Update version --- zooz.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zooz.gemspec b/zooz.gemspec index 2b99c8a..b8f8db8 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.6c' + s.version = '1.0.7' s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From b91515e60be19690b99cf7227096b5260598c21e Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 15:49:15 +0200 Subject: [PATCH 12/18] UnsupportedError was undefined --- lib/zooz/response.rb | 2 +- zooz.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zooz/response.rb b/lib/zooz/response.rb index ddf0912..f537685 100644 --- a/lib/zooz/response.rb +++ b/lib/zooz/response.rb @@ -29,7 +29,7 @@ def parsed_response def parsed_json_response begin @json_response = JSON.parse(http_body) - rescue UnparserError + rescue JSON::UnparserError @json_response = nil end end diff --git a/zooz.gemspec b/zooz.gemspec index b8f8db8..9c3706d 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.7' + s.version = '1.0.8' s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From 82c4c7f00f757d0a3b66cecfadb3d2184fc26d80 Mon Sep 17 00:00:00 2001 From: awayo Date: Wed, 16 Oct 2013 15:56:01 +0200 Subject: [PATCH 13/18] Added a rescue to Error At JSON parse --- lib/zooz/response.rb | 2 +- zooz.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zooz/response.rb b/lib/zooz/response.rb index f537685..3ad76b3 100644 --- a/lib/zooz/response.rb +++ b/lib/zooz/response.rb @@ -29,7 +29,7 @@ def parsed_response def parsed_json_response begin @json_response = JSON.parse(http_body) - rescue JSON::UnparserError + rescue @json_response = nil end end diff --git a/zooz.gemspec b/zooz.gemspec index 9c3706d..654a6bf 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.8' + s.version = '1.0.9' s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From 255dc737d4fb110d4c905ad5082f0e19bb52111b Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Thu, 16 Jan 2014 17:25:32 +0100 Subject: [PATCH 14/18] Added url as a parameter --- lib/zooz/request.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/zooz/request.rb b/lib/zooz/request.rb index 9686d78..0a751f5 100644 --- a/lib/zooz/request.rb +++ b/lib/zooz/request.rb @@ -12,6 +12,7 @@ def initialize @response_type = 'NVP' @sandbox = false @headers = {} + @url = '' end # Set a request parameter. @@ -36,12 +37,13 @@ def is_sandbox? # Get the URL of the API, based on whether in sandbox mode or not. def url if @response_type.eql?('NVP') - (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + + @url = (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + '/mobile/SecuredWebServlet' else - (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + + @url = (is_sandbox? ? 'https://sandbox.zooz.co' : 'https://app.zooz.com') + '/mobile/ExtendedServerAPI' end + @url end # Send a request to the server, returns a Zooz::Response object or false. From 814283a212bf94967f525943dc0b86f8cd48b2bd Mon Sep 17 00:00:00 2001 From: Francisco Soto Date: Thu, 16 Jan 2014 17:27:18 +0100 Subject: [PATCH 15/18] new version --- zooz.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zooz.gemspec b/zooz.gemspec index 654a6bf..c1e0cf6 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.9' + s.version = '1.0.10' s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" From af9c2ea97150315398d3f58bc742c4b7469e0434 Mon Sep 17 00:00:00 2001 From: awayo Date: Thu, 27 Mar 2014 11:39:24 +0100 Subject: [PATCH 16/18] Update gemspec --- zooz.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zooz.gemspec b/zooz.gemspec index 654a6bf..ced66dd 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE", "*.md"] s.require_path = 'lib' s.homepage = 'https://github.com/Miniand/zooz-ruby' - s.add_dependency('activesupport', '~> 4.0.0') + s.add_dependency('activesupport', '~> 4') s.add_dependency('httparty', '~> 0.8.0') s.add_dependency('json') end From a2909b0b3523bf45677c857383af67d63b1437c6 Mon Sep 17 00:00:00 2001 From: awayo Date: Thu, 3 Jul 2014 20:43:30 +0200 Subject: [PATCH 17/18] Added missing attr_accessor :requestor, commit ee9205b9f4373c8c71fda18fde7697e6fe350672 in Lostmyname's branch --- lib/zooz/request/verify.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zooz/request/verify.rb b/lib/zooz/request/verify.rb index 7f4bfa3..dae03e3 100644 --- a/lib/zooz/request/verify.rb +++ b/lib/zooz/request/verify.rb @@ -5,7 +5,7 @@ module Zooz class Request class Verify - attr_accessor :trx_id + attr_accessor :trx_id, :requestor attr_reader :errors delegate :sandbox, :sandbox=, :unique_id, :unique_id=, :app_key, :app_key=, :response_type, :response_type=, :cmd, :cmd=, :is_sandbox?, From 50a9afd9899b819602e64cf2f511b7ff1b85fd3e Mon Sep 17 00:00:00 2001 From: awayo Date: Thu, 3 Jul 2014 20:49:57 +0200 Subject: [PATCH 18/18] Increment version --- zooz.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zooz.gemspec b/zooz.gemspec index 04c7d1f..ac7d00e 100644 --- a/zooz.gemspec +++ b/zooz.gemspec @@ -1,10 +1,10 @@ Gem::Specification.new do |s| s.name = 'zooz' - s.version = '1.0.10' + s.version = '1.0.11' s.date = '2013-10-16' s.summary = "ZooZ" s.description = "A ZooZ API library for Ruby" - s.authors = ["Michael Alexander", "Francisco Soto"] + s.authors = ["Michael Alexander", "Francisco Soto", "Lostmyname"] s.email = 'beefsack@gmail.com' s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE", "*.md"] s.require_path = 'lib'