tradenity 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +89 -77
  4. data/lib/tradenity/api_client.rb +408 -0
  5. data/lib/tradenity/api_error.rb +36 -0
  6. data/lib/tradenity/configuration.rb +205 -0
  7. data/lib/tradenity/exceptions.rb +5 -0
  8. data/lib/tradenity/rails/railtie.rb +20 -20
  9. data/lib/tradenity/resources/address.rb +729 -0
  10. data/lib/tradenity/resources/braintree_gateway.rb +804 -0
  11. data/lib/tradenity/resources/brand.rb +732 -0
  12. data/lib/tradenity/resources/cancel_operation.rb +675 -0
  13. data/lib/tradenity/resources/cart_settings.rb +219 -0
  14. data/lib/tradenity/resources/cash_on_delivery_payment.rb +746 -0
  15. data/lib/tradenity/resources/category.rb +763 -0
  16. data/lib/tradenity/resources/collection.rb +734 -0
  17. data/lib/tradenity/resources/contact_info.rb +306 -0
  18. data/lib/tradenity/resources/countries_geo_zone.rb +739 -0
  19. data/lib/tradenity/resources/country.rb +803 -0
  20. data/lib/tradenity/resources/coupon.rb +454 -0
  21. data/lib/tradenity/resources/credit_card_payment.rb +803 -0
  22. data/lib/tradenity/resources/currency.rb +762 -0
  23. data/lib/tradenity/resources/customer.rb +816 -0
  24. data/lib/tradenity/resources/customer_group.rb +723 -0
  25. data/lib/tradenity/resources/dimensions.rb +263 -0
  26. data/lib/tradenity/resources/discount_coupon.rb +811 -0
  27. data/lib/tradenity/resources/discount_promotion.rb +784 -0
  28. data/lib/tradenity/resources/fixed_rate_shipping.rb +837 -0
  29. data/lib/tradenity/resources/free_item_coupon.rb +793 -0
  30. data/lib/tradenity/resources/free_shipping.rb +806 -0
  31. data/lib/tradenity/resources/free_shipping_coupon.rb +788 -0
  32. data/lib/tradenity/resources/free_shipping_promotion.rb +744 -0
  33. data/lib/tradenity/resources/gateway.rb +435 -0
  34. data/lib/tradenity/resources/general_settings.rb +206 -0
  35. data/lib/tradenity/resources/geo_zone.rb +406 -0
  36. data/lib/tradenity/resources/instance_meta.rb +182 -0
  37. data/lib/tradenity/resources/inventory_settings.rb +197 -0
  38. data/lib/tradenity/resources/items_selector.rb +270 -0
  39. data/lib/tradenity/resources/line_item.rb +347 -0
  40. data/lib/tradenity/resources/mail_server_settings.rb +221 -0
  41. data/lib/tradenity/resources/measurement_settings.rb +253 -0
  42. data/lib/tradenity/resources/option.rb +787 -0
  43. data/lib/tradenity/resources/option_set.rb +734 -0
  44. data/lib/tradenity/resources/option_value.rb +680 -0
  45. data/lib/tradenity/resources/order.rb +929 -0
  46. data/lib/tradenity/resources/order_line_item.rb +777 -0
  47. data/lib/tradenity/resources/paging.rb +38 -0
  48. data/lib/tradenity/resources/payment.rb +429 -0
  49. data/lib/tradenity/resources/payment_card.rb +847 -0
  50. data/lib/tradenity/resources/payment_settings.rb +201 -0
  51. data/lib/tradenity/resources/payment_source.rb +392 -0
  52. data/lib/tradenity/resources/payment_token.rb +723 -0
  53. data/lib/tradenity/resources/payment_transaction.rb +740 -0
  54. data/lib/tradenity/resources/photo.rb +341 -0
  55. data/lib/tradenity/resources/product.rb +1156 -0
  56. data/lib/tradenity/resources/promotion.rb +427 -0
  57. data/lib/tradenity/resources/refund_operation.rb +358 -0
  58. data/lib/tradenity/resources/refund_transaction.rb +730 -0
  59. data/lib/tradenity/resources/return_line_item.rb +781 -0
  60. data/lib/tradenity/resources/return_operation.rb +686 -0
  61. data/lib/tradenity/resources/return_settings.rb +255 -0
  62. data/lib/tradenity/resources/shipping_method.rb +530 -0
  63. data/lib/tradenity/resources/shopping_cart.rb +647 -0
  64. data/lib/tradenity/resources/state.rb +675 -0
  65. data/lib/tradenity/resources/states_geo_zone.rb +748 -0
  66. data/lib/tradenity/resources/store_credit.rb +686 -0
  67. data/lib/tradenity/resources/store_credit_payment.rb +764 -0
  68. data/lib/tradenity/resources/store_credit_transaction.rb +730 -0
  69. data/lib/tradenity/resources/store_profile.rb +532 -0
  70. data/lib/tradenity/resources/stripe_gateway.rb +804 -0
  71. data/lib/tradenity/resources/table_rate_rule.rb +712 -0
  72. data/lib/tradenity/resources/table_rate_shipping.rb +834 -0
  73. data/lib/tradenity/resources/tax_class.rb +723 -0
  74. data/lib/tradenity/resources/tax_rate.rb +845 -0
  75. data/lib/tradenity/resources/tax_settings.rb +231 -0
  76. data/lib/tradenity/resources/test_gateway.rb +804 -0
  77. data/lib/tradenity/resources/transaction.rb +523 -0
  78. data/lib/tradenity/resources/utils.rb +7 -0
  79. data/lib/tradenity/resources/variant.rb +877 -0
  80. data/lib/tradenity/resources/web_hooks.rb +262 -0
  81. data/lib/tradenity/resources/weight.rb +235 -0
  82. data/lib/tradenity/resources/wish_list.rb +686 -0
  83. data/lib/tradenity/resources/zip_codes_geo_zone.rb +755 -0
  84. data/lib/tradenity/token_holder.rb +22 -0
  85. data/lib/tradenity/version.rb +13 -3
  86. data/lib/tradenity.rb +117 -7
  87. data/tradenity.gemspec +35 -30
  88. metadata +200 -34
  89. data/lib/tradenity/api.rb +0 -17
  90. data/lib/tradenity/error/exceptions.rb +0 -52
  91. data/lib/tradenity/error/message.rb +0 -38
  92. data/lib/tradenity/http/client.rb +0 -130
  93. data/lib/tradenity/model/base.rb +0 -100
  94. data/lib/tradenity/model/entities.rb +0 -390
  95. data/lib/tradenity/model/paging.rb +0 -23
@@ -0,0 +1,22 @@
1
+ module Tradenity
2
+ class SessionTokenHolder
3
+
4
+ attr_accessor :session
5
+
6
+ def has_token?
7
+ @session.has_key? :session_token
8
+ end
9
+
10
+ def set_token(token)
11
+ @session[:session_token] = token
12
+ end
13
+
14
+ def get_token
15
+ @session[:session_token]
16
+ end
17
+
18
+ def reset
19
+ @session.delete :session_token
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,13 @@
1
- module Tradenity
2
- VERSION = "0.1.1"
3
- end
1
+ =begin
2
+ #Tradenity API
3
+
4
+ #Tradenity eCommerce Rest API
5
+
6
+ Contact: support@tradenity.com
7
+ Generated by: https://github.com/tradenity
8
+
9
+ =end
10
+
11
+ module Tradenity
12
+ VERSION = '1.0.0'
13
+ end
data/lib/tradenity.rb CHANGED
@@ -1,7 +1,117 @@
1
- require 'tradenity/api'
2
- require 'tradenity/error/exceptions'
3
- require 'tradenity/http/client'
4
- require 'tradenity/model/paging'
5
- require 'tradenity/model/base'
6
- require 'tradenity/model/entities'
7
- require 'tradenity/rails/railtie' if defined?(Rails)
1
+ =begin
2
+ #Tradenity API
3
+
4
+ #Tradenity eCommerce Rest API
5
+
6
+ Contact: support@tradenity.com
7
+ Generated by: https://github.com/tradenity
8
+
9
+ =end
10
+
11
+ # Common files
12
+ require 'tradenity/token_holder'
13
+ require 'tradenity/api_client'
14
+ require 'tradenity/api_error'
15
+ require 'tradenity/version'
16
+ require 'tradenity/configuration'
17
+ require 'tradenity/exceptions'
18
+
19
+ # Rails
20
+ require 'tradenity/rails/railtie' if defined?(Rails)
21
+
22
+ # Models
23
+ require 'tradenity/resources/utils.rb'
24
+ require 'tradenity/resources/paging.rb'
25
+ require 'tradenity/resources/address'
26
+ require 'tradenity/resources/braintree_gateway'
27
+ require 'tradenity/resources/brand'
28
+ require 'tradenity/resources/cancel_operation'
29
+ require 'tradenity/resources/cart_settings'
30
+ require 'tradenity/resources/cash_on_delivery_payment'
31
+ require 'tradenity/resources/category'
32
+ require 'tradenity/resources/collection'
33
+ require 'tradenity/resources/contact_info'
34
+ require 'tradenity/resources/countries_geo_zone'
35
+ require 'tradenity/resources/country'
36
+ require 'tradenity/resources/coupon'
37
+ require 'tradenity/resources/credit_card_payment'
38
+ require 'tradenity/resources/currency'
39
+ require 'tradenity/resources/customer'
40
+ require 'tradenity/resources/customer_group'
41
+ require 'tradenity/resources/dimensions'
42
+ require 'tradenity/resources/discount_coupon'
43
+ require 'tradenity/resources/discount_promotion'
44
+ require 'tradenity/resources/fixed_rate_shipping'
45
+ require 'tradenity/resources/free_item_coupon'
46
+ require 'tradenity/resources/free_shipping'
47
+ require 'tradenity/resources/free_shipping_coupon'
48
+ require 'tradenity/resources/free_shipping_promotion'
49
+ require 'tradenity/resources/gateway'
50
+ require 'tradenity/resources/general_settings'
51
+ require 'tradenity/resources/geo_zone'
52
+ require 'tradenity/resources/instance_meta'
53
+ require 'tradenity/resources/inventory_settings'
54
+ require 'tradenity/resources/items_selector'
55
+ require 'tradenity/resources/line_item'
56
+ require 'tradenity/resources/mail_server_settings'
57
+ require 'tradenity/resources/measurement_settings'
58
+ require 'tradenity/resources/option'
59
+ require 'tradenity/resources/option_set'
60
+ require 'tradenity/resources/option_value'
61
+ require 'tradenity/resources/order'
62
+ require 'tradenity/resources/order_line_item'
63
+ require 'tradenity/resources/payment'
64
+ require 'tradenity/resources/payment_card'
65
+ require 'tradenity/resources/payment_settings'
66
+ require 'tradenity/resources/payment_source'
67
+ require 'tradenity/resources/payment_token'
68
+ require 'tradenity/resources/payment_transaction'
69
+ require 'tradenity/resources/photo'
70
+ require 'tradenity/resources/product'
71
+ require 'tradenity/resources/promotion'
72
+ require 'tradenity/resources/refund_operation'
73
+ require 'tradenity/resources/refund_transaction'
74
+ require 'tradenity/resources/return_line_item'
75
+ require 'tradenity/resources/return_operation'
76
+ require 'tradenity/resources/return_settings'
77
+ require 'tradenity/resources/shipping_method'
78
+ require 'tradenity/resources/shopping_cart'
79
+ require 'tradenity/resources/state'
80
+ require 'tradenity/resources/states_geo_zone'
81
+ require 'tradenity/resources/store_credit'
82
+ require 'tradenity/resources/store_credit_payment'
83
+ require 'tradenity/resources/store_credit_transaction'
84
+ require 'tradenity/resources/store_profile'
85
+ require 'tradenity/resources/stripe_gateway'
86
+ require 'tradenity/resources/table_rate_rule'
87
+ require 'tradenity/resources/table_rate_shipping'
88
+ require 'tradenity/resources/tax_class'
89
+ require 'tradenity/resources/tax_rate'
90
+ require 'tradenity/resources/tax_settings'
91
+ require 'tradenity/resources/test_gateway'
92
+ require 'tradenity/resources/transaction'
93
+ require 'tradenity/resources/variant'
94
+ require 'tradenity/resources/web_hooks'
95
+ require 'tradenity/resources/weight'
96
+ require 'tradenity/resources/wish_list'
97
+ require 'tradenity/resources/zip_codes_geo_zone'
98
+
99
+
100
+
101
+ module Tradenity
102
+ class << self
103
+ # Customize default settings for the SDK using block.
104
+ # Tradenity.configure do |config|
105
+ # config.username = "xxx"
106
+ # config.password = "xxx"
107
+ # end
108
+ # If no block given, return the default Configuration object.
109
+ def configure
110
+ if block_given?
111
+ yield(Configuration.default)
112
+ else
113
+ Configuration.default
114
+ end
115
+ end
116
+ end
117
+ end
data/tradenity.gemspec CHANGED
@@ -1,30 +1,35 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'tradenity/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "tradenity"
8
- spec.version = Tradenity::VERSION
9
- spec.authors = ["Joseph Fouad"]
10
- spec.email = ["tradenity@tradenity.com"]
11
-
12
-
13
-
14
- spec.summary = %q{Access Tradenity eCommerce API.}
15
- spec.description = %q{Client library for easy develop against Tradenity eCommerce REST API.}
16
- spec.homepage = "http://githun.com/tradenity/ruby-sdk"
17
- spec.license = "Apache-2.0"
18
-
19
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
- spec.bindir = "bin"
21
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
- spec.require_paths = ["lib"]
23
-
24
- spec.add_runtime_dependency 'virtus', '~> 1.0', '>= 1.0.5'
25
- spec.add_runtime_dependency 'unirest', '~> 1.1', '>= 1.1.2'
26
- spec.add_runtime_dependency 'bcrypt', '~> 3.1', '>= 3.1.1'
27
-
28
- spec.add_development_dependency "bundler", "~> 1.8"
29
- spec.add_development_dependency "rake", "~> 10.0"
30
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'tradenity/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "tradenity"
8
+ spec.version = Tradenity::VERSION
9
+ spec.authors = ["Joseph Fouad"]
10
+ spec.email = ["support@tradenity.com"]
11
+
12
+ spec.summary = %q{SDK for Tradenity eCommerce API.}
13
+ spec.description = %q{Client library for easy eCommerce app development with Tradenity eCommerce API.}
14
+ spec.homepage = "http://githun.com/tradenity/ruby-sdk"
15
+ spec.license = "Apache-2.0"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "bin"
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.required_ruby_version = ">= 1.9"
23
+
24
+ spec.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
25
+ spec.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
26
+
27
+ spec.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
28
+ spec.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
29
+ spec.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
30
+ spec.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
31
+ spec.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
32
+ spec.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
33
+ spec.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
34
+
35
+ end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tradenity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Fouad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-30 00:00:00.000000000 Z
11
+ date: 2019-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: virtus
14
+ name: typhoeus
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.5
22
+ version: 1.0.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,78 +29,171 @@ dependencies:
29
29
  version: '1.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.0.5
32
+ version: 1.0.1
33
33
  - !ruby/object:Gem::Dependency
34
- name: unirest
34
+ name: json
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.1'
39
+ version: '2.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.1.2
42
+ version: 2.1.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '1.1'
49
+ version: '2.1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.1.2
52
+ version: 2.1.0
53
53
  - !ruby/object:Gem::Dependency
54
- name: bcrypt
54
+ name: rspec
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '3.1'
59
+ version: '3.6'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 3.1.1
63
- type: :runtime
62
+ version: 3.6.0
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '3.6'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 3.6.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: vcr
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '3.0'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 3.0.1
83
+ type: :development
64
84
  prerelease: false
65
85
  version_requirements: !ruby/object:Gem::Requirement
66
86
  requirements:
67
87
  - - "~>"
68
88
  - !ruby/object:Gem::Version
69
- version: '3.1'
89
+ version: '3.0'
70
90
  - - ">="
71
91
  - !ruby/object:Gem::Version
72
- version: 3.1.1
92
+ version: 3.0.1
73
93
  - !ruby/object:Gem::Dependency
74
- name: bundler
94
+ name: webmock
75
95
  requirement: !ruby/object:Gem::Requirement
76
96
  requirements:
77
97
  - - "~>"
78
98
  - !ruby/object:Gem::Version
79
- version: '1.8'
99
+ version: '1.24'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.24.3
80
103
  type: :development
81
104
  prerelease: false
82
105
  version_requirements: !ruby/object:Gem::Requirement
83
106
  requirements:
84
107
  - - "~>"
85
108
  - !ruby/object:Gem::Version
86
- version: '1.8'
109
+ version: '1.24'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.24.3
87
113
  - !ruby/object:Gem::Dependency
88
- name: rake
114
+ name: autotest
89
115
  requirement: !ruby/object:Gem::Requirement
90
116
  requirements:
91
117
  - - "~>"
92
118
  - !ruby/object:Gem::Version
93
- version: '10.0'
119
+ version: '4.4'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 4.4.6
94
123
  type: :development
95
124
  prerelease: false
96
125
  version_requirements: !ruby/object:Gem::Requirement
97
126
  requirements:
98
127
  - - "~>"
99
128
  - !ruby/object:Gem::Version
100
- version: '10.0'
101
- description: Client library for easy develop against Tradenity eCommerce REST API.
129
+ version: '4.4'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 4.4.6
133
+ - !ruby/object:Gem::Dependency
134
+ name: autotest-rails-pure
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '4.1'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 4.1.2
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '4.1'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 4.1.2
153
+ - !ruby/object:Gem::Dependency
154
+ name: autotest-growl
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '0.2'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 0.2.16
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '0.2'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 0.2.16
173
+ - !ruby/object:Gem::Dependency
174
+ name: autotest-fsevent
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.2'
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 0.2.12
183
+ type: :development
184
+ prerelease: false
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - "~>"
188
+ - !ruby/object:Gem::Version
189
+ version: '0.2'
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: 0.2.12
193
+ description: Client library for easy eCommerce app development with Tradenity eCommerce
194
+ API.
102
195
  email:
103
- - tradenity@tradenity.com
196
+ - support@tradenity.com
104
197
  executables:
105
198
  - console
106
199
  - setup
@@ -119,14 +212,87 @@ files:
119
212
  - bin/console
120
213
  - bin/setup
121
214
  - lib/tradenity.rb
122
- - lib/tradenity/api.rb
123
- - lib/tradenity/error/exceptions.rb
124
- - lib/tradenity/error/message.rb
125
- - lib/tradenity/http/client.rb
126
- - lib/tradenity/model/base.rb
127
- - lib/tradenity/model/entities.rb
128
- - lib/tradenity/model/paging.rb
215
+ - lib/tradenity/api_client.rb
216
+ - lib/tradenity/api_error.rb
217
+ - lib/tradenity/configuration.rb
218
+ - lib/tradenity/exceptions.rb
129
219
  - lib/tradenity/rails/railtie.rb
220
+ - lib/tradenity/resources/address.rb
221
+ - lib/tradenity/resources/braintree_gateway.rb
222
+ - lib/tradenity/resources/brand.rb
223
+ - lib/tradenity/resources/cancel_operation.rb
224
+ - lib/tradenity/resources/cart_settings.rb
225
+ - lib/tradenity/resources/cash_on_delivery_payment.rb
226
+ - lib/tradenity/resources/category.rb
227
+ - lib/tradenity/resources/collection.rb
228
+ - lib/tradenity/resources/contact_info.rb
229
+ - lib/tradenity/resources/countries_geo_zone.rb
230
+ - lib/tradenity/resources/country.rb
231
+ - lib/tradenity/resources/coupon.rb
232
+ - lib/tradenity/resources/credit_card_payment.rb
233
+ - lib/tradenity/resources/currency.rb
234
+ - lib/tradenity/resources/customer.rb
235
+ - lib/tradenity/resources/customer_group.rb
236
+ - lib/tradenity/resources/dimensions.rb
237
+ - lib/tradenity/resources/discount_coupon.rb
238
+ - lib/tradenity/resources/discount_promotion.rb
239
+ - lib/tradenity/resources/fixed_rate_shipping.rb
240
+ - lib/tradenity/resources/free_item_coupon.rb
241
+ - lib/tradenity/resources/free_shipping.rb
242
+ - lib/tradenity/resources/free_shipping_coupon.rb
243
+ - lib/tradenity/resources/free_shipping_promotion.rb
244
+ - lib/tradenity/resources/gateway.rb
245
+ - lib/tradenity/resources/general_settings.rb
246
+ - lib/tradenity/resources/geo_zone.rb
247
+ - lib/tradenity/resources/instance_meta.rb
248
+ - lib/tradenity/resources/inventory_settings.rb
249
+ - lib/tradenity/resources/items_selector.rb
250
+ - lib/tradenity/resources/line_item.rb
251
+ - lib/tradenity/resources/mail_server_settings.rb
252
+ - lib/tradenity/resources/measurement_settings.rb
253
+ - lib/tradenity/resources/option.rb
254
+ - lib/tradenity/resources/option_set.rb
255
+ - lib/tradenity/resources/option_value.rb
256
+ - lib/tradenity/resources/order.rb
257
+ - lib/tradenity/resources/order_line_item.rb
258
+ - lib/tradenity/resources/paging.rb
259
+ - lib/tradenity/resources/payment.rb
260
+ - lib/tradenity/resources/payment_card.rb
261
+ - lib/tradenity/resources/payment_settings.rb
262
+ - lib/tradenity/resources/payment_source.rb
263
+ - lib/tradenity/resources/payment_token.rb
264
+ - lib/tradenity/resources/payment_transaction.rb
265
+ - lib/tradenity/resources/photo.rb
266
+ - lib/tradenity/resources/product.rb
267
+ - lib/tradenity/resources/promotion.rb
268
+ - lib/tradenity/resources/refund_operation.rb
269
+ - lib/tradenity/resources/refund_transaction.rb
270
+ - lib/tradenity/resources/return_line_item.rb
271
+ - lib/tradenity/resources/return_operation.rb
272
+ - lib/tradenity/resources/return_settings.rb
273
+ - lib/tradenity/resources/shipping_method.rb
274
+ - lib/tradenity/resources/shopping_cart.rb
275
+ - lib/tradenity/resources/state.rb
276
+ - lib/tradenity/resources/states_geo_zone.rb
277
+ - lib/tradenity/resources/store_credit.rb
278
+ - lib/tradenity/resources/store_credit_payment.rb
279
+ - lib/tradenity/resources/store_credit_transaction.rb
280
+ - lib/tradenity/resources/store_profile.rb
281
+ - lib/tradenity/resources/stripe_gateway.rb
282
+ - lib/tradenity/resources/table_rate_rule.rb
283
+ - lib/tradenity/resources/table_rate_shipping.rb
284
+ - lib/tradenity/resources/tax_class.rb
285
+ - lib/tradenity/resources/tax_rate.rb
286
+ - lib/tradenity/resources/tax_settings.rb
287
+ - lib/tradenity/resources/test_gateway.rb
288
+ - lib/tradenity/resources/transaction.rb
289
+ - lib/tradenity/resources/utils.rb
290
+ - lib/tradenity/resources/variant.rb
291
+ - lib/tradenity/resources/web_hooks.rb
292
+ - lib/tradenity/resources/weight.rb
293
+ - lib/tradenity/resources/wish_list.rb
294
+ - lib/tradenity/resources/zip_codes_geo_zone.rb
295
+ - lib/tradenity/token_holder.rb
130
296
  - lib/tradenity/version.rb
131
297
  - tradenity.gemspec
132
298
  homepage: http://githun.com/tradenity/ruby-sdk
@@ -141,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
307
  requirements:
142
308
  - - ">="
143
309
  - !ruby/object:Gem::Version
144
- version: '0'
310
+ version: '1.9'
145
311
  required_rubygems_version: !ruby/object:Gem::Requirement
146
312
  requirements:
147
313
  - - ">="
@@ -149,8 +315,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
315
  version: '0'
150
316
  requirements: []
151
317
  rubyforge_project:
152
- rubygems_version: 2.6.7
318
+ rubygems_version: 2.7.3
153
319
  signing_key:
154
320
  specification_version: 4
155
- summary: Access Tradenity eCommerce API.
321
+ summary: SDK for Tradenity eCommerce API.
156
322
  test_files: []
data/lib/tradenity/api.rb DELETED
@@ -1,17 +0,0 @@
1
-
2
- module Tradenity
3
-
4
-
5
- @api_key = ''
6
- @api_base = 'https://api.tradenity.com/v1'
7
-
8
- class << self
9
- attr_accessor :api_key, :api_base
10
-
11
- def reset_current_session
12
- puts 'Resetting in Tradenity self...'
13
- Tradenity::HttpClient.get_instance.reset_current_session
14
- end
15
- end
16
-
17
- end
@@ -1,52 +0,0 @@
1
- module Tradenity
2
-
3
- class ClientErrorException < RuntimeError
4
-
5
- end
6
-
7
- class ServerErrorException < RuntimeError
8
-
9
- end
10
-
11
- class RequestErrorException < RuntimeError
12
- def initialize(error)
13
- super(error.message) if error != nil
14
- @error = error
15
- end
16
- end
17
-
18
- class AuthenticationException < RequestErrorException
19
- end
20
-
21
-
22
- class SessionExpiredException < RequestErrorException
23
- end
24
-
25
-
26
- class AuthorizationException < RequestErrorException
27
- end
28
-
29
-
30
- class EntityNotFoundException < RequestErrorException
31
- end
32
-
33
-
34
- class DataValidationException < RequestErrorException
35
- end
36
-
37
-
38
- class PaymentErrorException < RequestErrorException
39
- end
40
-
41
-
42
- class CustomerCreationException < RequestErrorException
43
- end
44
-
45
-
46
- class ShoppingCartException < RequestErrorException
47
- end
48
-
49
-
50
- class InventoryErrorException < RequestErrorException
51
- end
52
- end
@@ -1,38 +0,0 @@
1
- require 'virtus'
2
-
3
- module Tradenity
4
-
5
- UNAUTHORIZED_ERROR_CODE = 1001
6
- ACCESS_DENIED_ERROR_CODE = 1002
7
-
8
- METHOD_NOT_SUPPORTED_ERROR_CODE = 1102
9
-
10
- NOT_FOUND_ERROR_CODE = 1201
11
- DATA_VALIDATION_ERROR_CODE = 1203
12
-
13
- INVALID_PAYMENT_ERROR_CODE = 1401
14
- REFUND_ERROR_ERROR_CODE = 1402
15
- GATEWAY_ERROR_ERROR_CODE = 1403
16
-
17
- EXISTING_EMAIL_ERROR_CODE = 1601
18
- EXISTING_USERNAME_ERROR_CODE = 1602
19
-
20
- CART_INVALID_ITEM_ERROR_CODE = 1701
21
-
22
- INVENTORY_INVALID_PRODUCT_ERROR_CODE = 1801
23
- INVENTORY_NOT_AVAILABLE_PRODUCT_ERROR_CODE = 1802
24
-
25
- class ErrorMessage
26
-
27
- include Virtus.model
28
-
29
- attribute :status, Integer
30
- attribute :errorCode, Integer
31
- attribute :error, String
32
- attribute :timestamp, String
33
- attribute :message, String
34
- attribute :details, Hash
35
- attribute :fieldErrors, Hash
36
- end
37
-
38
- end