spree_exactor 1.1.1.112920126

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/.rspec +1 -0
  2. data/Gemfile.lock +231 -0
  3. data/README.md +21 -0
  4. data/app/assets/javascripts/admin/exactor_settings.js +2 -0
  5. data/app/assets/javascripts/admin/spree_exactor.js +1 -0
  6. data/app/assets/javascripts/store/spree_exactor.js +1 -0
  7. data/app/assets/stylesheets/admin/spree_exactor.css +3 -0
  8. data/app/assets/stylesheets/exactor_settings.css +4 -0
  9. data/app/assets/stylesheets/store/spree_exactor.css +3 -0
  10. data/app/controllers/spree/admin/exactor_settings_controller.rb +34 -0
  11. data/app/helpers/exactor_api_objects.rb +387 -0
  12. data/app/helpers/exactor_api_service.rb +96 -0
  13. data/app/helpers/spree_exactor_connector.rb +380 -0
  14. data/app/models/spree/adjustment_decorator.rb +41 -0
  15. data/app/models/spree/calculator/exactor_tax_calculator.rb +87 -0
  16. data/app/models/spree/exactor_setting.rb +140 -0
  17. data/app/models/spree/line_item_decorator.rb +31 -0
  18. data/app/models/spree/order_decorator.rb +126 -0
  19. data/app/models/spree/payment_decorator.rb +15 -0
  20. data/app/models/spree/tax_category_decorator.rb +31 -0
  21. data/app/models/spree/tax_rate_decorator.rb +46 -0
  22. data/app/models/spree/user_decorator.rb +7 -0
  23. data/app/models/spree/zone_decorator.rb +31 -0
  24. data/app/overrides/spree_exactor_overrides.rb +27 -0
  25. data/app/views/spree/admin/exactor_settings/show.html.erb +113 -0
  26. data/config/locales/en.yml +10 -0
  27. data/config/routes.rb +6 -0
  28. data/db/migrate/20120624223025_create_exactor_settings.rb +20 -0
  29. data/db/migrate/20120627130223_add_exactor_info_to_order.rb +8 -0
  30. data/db/migrate/20120705103207_add_exactor_indicator_to_tax_rates.rb +5 -0
  31. data/db/migrate/20120713152512_modify_dependent_entities.rb +6 -0
  32. data/db/migrate/20120813124740_extend_user.rb +5 -0
  33. data/db/migrate/20120815104739_add_exactor_tor_inline_tax.rb +5 -0
  34. data/lib/generators/spree_exactor/install/install_generator.rb +80 -0
  35. data/lib/generators/spree_exactor/uninstall/uninstall_generator.rb +24 -0
  36. data/lib/spree_exactor/engine.rb +25 -0
  37. data/lib/spree_exactor.rb +2 -0
  38. data/spree_exactor.gemspec +66 -0
  39. metadata +197 -0
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/Gemfile.lock ADDED
@@ -0,0 +1,231 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ spree_exactor (1.1.1.112920126)
5
+ spree_core (>= 1.1.1)
6
+ xml-simple
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.9)
12
+ actionpack (= 3.2.9)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.9)
15
+ activemodel (= 3.2.9)
16
+ activesupport (= 3.2.9)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.4)
20
+ rack (~> 1.4.0)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.2.1)
24
+ active_utils (1.0.5)
25
+ activesupport (>= 2.3.11)
26
+ i18n
27
+ activemerchant (1.28.0)
28
+ active_utils (>= 1.0.2)
29
+ activesupport (>= 2.3.11)
30
+ builder (>= 2.0.0)
31
+ i18n
32
+ json (>= 1.5.1)
33
+ money
34
+ nokogiri
35
+ activemodel (3.2.9)
36
+ activesupport (= 3.2.9)
37
+ builder (~> 3.0.0)
38
+ activerecord (3.2.9)
39
+ activemodel (= 3.2.9)
40
+ activesupport (= 3.2.9)
41
+ arel (~> 3.0.2)
42
+ tzinfo (~> 0.3.29)
43
+ activeresource (3.2.9)
44
+ activemodel (= 3.2.9)
45
+ activesupport (= 3.2.9)
46
+ activesupport (3.2.9)
47
+ i18n (~> 0.6)
48
+ multi_json (~> 1.0)
49
+ acts_as_list (0.1.4)
50
+ addressable (2.3.2)
51
+ archive-tar-minitar (0.5.2)
52
+ arel (3.0.2)
53
+ awesome_nested_set (2.1.4)
54
+ activerecord (>= 3.0.0)
55
+ aws-sdk (1.3.9)
56
+ httparty (~> 0.7)
57
+ json (~> 1.4)
58
+ nokogiri (>= 1.4.4)
59
+ uuidtools (~> 2.1)
60
+ builder (3.0.4)
61
+ cancan (1.6.7)
62
+ capybara (1.0.1)
63
+ mime-types (>= 1.16)
64
+ nokogiri (>= 1.3.3)
65
+ rack (>= 1.0.0)
66
+ rack-test (>= 0.5.4)
67
+ selenium-webdriver (~> 2.0)
68
+ xpath (~> 0.1.4)
69
+ childprocess (0.3.6)
70
+ ffi (~> 1.0, >= 1.0.6)
71
+ cocaine (0.4.2)
72
+ columnize (0.3.6)
73
+ deface (0.9.1)
74
+ nokogiri (~> 1.5.0)
75
+ rails (~> 3.1)
76
+ diff-lcs (1.1.3)
77
+ erubis (2.7.0)
78
+ factory_girl (2.6.4)
79
+ activesupport (>= 2.3.9)
80
+ ffaker (1.12.1)
81
+ ffi (1.2.0)
82
+ highline (1.6.11)
83
+ hike (1.2.1)
84
+ httparty (0.9.0)
85
+ multi_json (~> 1.0)
86
+ multi_xml
87
+ i18n (0.6.1)
88
+ journey (1.0.4)
89
+ jquery-rails (2.1.4)
90
+ railties (>= 3.0, < 5.0)
91
+ thor (>= 0.14, < 2.0)
92
+ json (1.7.5)
93
+ kaminari (0.13.0)
94
+ actionpack (>= 3.0.0)
95
+ activesupport (>= 3.0.0)
96
+ railties (>= 3.0.0)
97
+ libwebsocket (0.1.7.1)
98
+ addressable
99
+ websocket
100
+ linecache19 (0.5.13)
101
+ ruby_core_source (>= 0.1.4)
102
+ mail (2.4.4)
103
+ i18n (>= 0.4.0)
104
+ mime-types (~> 1.16)
105
+ treetop (~> 1.4.8)
106
+ mime-types (1.19)
107
+ money (5.0.0)
108
+ i18n (~> 0.4)
109
+ json
110
+ multi_json (1.3.7)
111
+ multi_xml (0.5.1)
112
+ nokogiri (1.5.5)
113
+ paperclip (2.8.0)
114
+ activerecord (>= 2.3.0)
115
+ activesupport (>= 2.3.2)
116
+ cocaine (>= 0.0.2)
117
+ mime-types
118
+ polyamorous (0.5.0)
119
+ activerecord (~> 3.0)
120
+ polyglot (0.3.3)
121
+ rabl (0.7.2)
122
+ activesupport (>= 2.3.14)
123
+ multi_json (~> 1.0)
124
+ rack (1.4.1)
125
+ rack-cache (1.2)
126
+ rack (>= 0.4)
127
+ rack-ssl (1.3.2)
128
+ rack
129
+ rack-test (0.6.2)
130
+ rack (>= 1.0)
131
+ rails (3.2.9)
132
+ actionmailer (= 3.2.9)
133
+ actionpack (= 3.2.9)
134
+ activerecord (= 3.2.9)
135
+ activeresource (= 3.2.9)
136
+ activesupport (= 3.2.9)
137
+ bundler (~> 1.0)
138
+ railties (= 3.2.9)
139
+ railties (3.2.9)
140
+ actionpack (= 3.2.9)
141
+ activesupport (= 3.2.9)
142
+ rack-ssl (~> 1.3.2)
143
+ rake (>= 0.8.7)
144
+ rdoc (~> 3.4)
145
+ thor (>= 0.14.6, < 2.0)
146
+ rake (10.0.2)
147
+ ransack (0.7.0)
148
+ actionpack (~> 3.0)
149
+ activerecord (~> 3.0)
150
+ polyamorous (~> 0.5.0)
151
+ rdoc (3.12)
152
+ json (~> 1.4)
153
+ rspec-core (2.12.0)
154
+ rspec-expectations (2.12.0)
155
+ diff-lcs (~> 1.1.3)
156
+ rspec-mocks (2.12.0)
157
+ rspec-rails (2.12.0)
158
+ actionpack (>= 3.0)
159
+ activesupport (>= 3.0)
160
+ railties (>= 3.0)
161
+ rspec-core (~> 2.12.0)
162
+ rspec-expectations (~> 2.12.0)
163
+ rspec-mocks (~> 2.12.0)
164
+ ruby-debug-base19 (0.11.25)
165
+ columnize (>= 0.3.1)
166
+ linecache19 (>= 0.5.11)
167
+ ruby_core_source (>= 0.1.4)
168
+ ruby-debug19 (0.11.6)
169
+ columnize (>= 0.3.1)
170
+ linecache19 (>= 0.5.11)
171
+ ruby-debug-base19 (>= 0.11.19)
172
+ ruby_core_source (0.1.5)
173
+ archive-tar-minitar (>= 0.5.2)
174
+ rubyzip (0.9.9)
175
+ select2-rails (3.2.1)
176
+ thor (~> 0.14)
177
+ selenium-webdriver (2.26.0)
178
+ childprocess (>= 0.2.5)
179
+ libwebsocket (~> 0.1.3)
180
+ multi_json (~> 1.0)
181
+ rubyzip
182
+ spree_core (1.2.2)
183
+ activemerchant (= 1.28.0)
184
+ acts_as_list (= 0.1.4)
185
+ awesome_nested_set (= 2.1.4)
186
+ aws-sdk (~> 1.3.4)
187
+ cancan (= 1.6.7)
188
+ deface (>= 0.9.0)
189
+ ffaker (~> 1.12.0)
190
+ highline (= 1.6.11)
191
+ jquery-rails (~> 2.0)
192
+ kaminari (= 0.13.0)
193
+ money (= 5.0.0)
194
+ paperclip (~> 2.8)
195
+ rabl (= 0.7.2)
196
+ rails (~> 3.2.9)
197
+ ransack (~> 0.7.0)
198
+ select2-rails (~> 3.0)
199
+ state_machine (= 1.1.2)
200
+ stringex (~> 1.3.2)
201
+ sprockets (2.2.2)
202
+ hike (~> 1.2)
203
+ multi_json (~> 1.0)
204
+ rack (~> 1.0)
205
+ tilt (~> 1.1, != 1.3.0)
206
+ sqlite3 (1.3.6)
207
+ state_machine (1.1.2)
208
+ stringex (1.3.3)
209
+ thor (0.16.0)
210
+ tilt (1.3.3)
211
+ treetop (1.4.12)
212
+ polyglot
213
+ polyglot (>= 0.3.1)
214
+ tzinfo (0.3.35)
215
+ uuidtools (2.1.3)
216
+ websocket (1.0.4)
217
+ xml-simple (1.1.2)
218
+ xpath (0.1.4)
219
+ nokogiri (~> 1.3)
220
+
221
+ PLATFORMS
222
+ ruby
223
+
224
+ DEPENDENCIES
225
+ capybara (= 1.0.1)
226
+ factory_girl (~> 2.6.4)
227
+ ffaker
228
+ rspec-rails (~> 2.9)
229
+ ruby-debug19
230
+ spree_exactor!
231
+ sqlite3
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ SpreeExactor
2
+ ============
3
+
4
+ Introduction goes here.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Example goes here.
11
+
12
+ Testing
13
+ -------
14
+
15
+ Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
16
+
17
+ $ bundle
18
+ $ bundle exec rake test_app
19
+ $ bundle exec rspec spec
20
+
21
+ Copyright (c) 2012 [name of extension creator], released under the New BSD License
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1 @@
1
+ //= require admin/spree_core
@@ -0,0 +1 @@
1
+ //= require store/spree_core
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require admin/spree_core
3
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require store/spree_core
3
+ */
@@ -0,0 +1,34 @@
1
+ #Exactor settings controller
2
+ class Spree::Admin::ExactorSettingsController < Spree::Admin::ResourceController
3
+
4
+ def show
5
+ @setting = Spree::ExactorSetting.get_settings()
6
+ if @setting.nil?
7
+ ship_from_country = Spree::Country.find(Spree::Config[:default_country_id]) rescue Spree::Country.first
8
+ @setting = Spree::ExactorSetting.new({:country => ship_from_country}, :without_protection => true)
9
+ @setting.country_id = ship_from_country.id;
10
+ end
11
+ respond_with(@setting)
12
+ end
13
+
14
+ def update
15
+ @setting = Spree::ExactorSetting.find(params[:id])
16
+ @setting.update_attributes(params[:exactor_setting])
17
+ if (@setting.errors.empty?)
18
+ flash.notice = flash_message_for(@setting, :exactor_settings_updated)
19
+ end
20
+ render :action => "show"
21
+ end
22
+
23
+ def create
24
+ @setting = Spree::ExactorSetting.new(params[:exactor_setting])
25
+ @setting.country =Spree::Country.find(@setting.country_id)
26
+ @setting.save
27
+ if (@setting.errors.empty?)
28
+ flash.notice = flash_message_for(@setting, :exactor_settings_created)
29
+ end
30
+ render :action => "show"
31
+ end
32
+
33
+
34
+ end
@@ -0,0 +1,387 @@
1
+ # encoding: ASCII-8BIT
2
+
3
+ class ComplexExactorObject
4
+ end
5
+ # {http://www.exactor.com/ns}InvoiceRequestType
6
+ # saleDate - SOAP::SOAPDate
7
+ # purchaseOrderNumber - SOAP::SOAPString
8
+ # currencyCode - CurrencyCodeType
9
+ # taxClass - TaxClassType
10
+ # taxDirection - TaxDirectionType
11
+ # exemptionId - SOAP::SOAPString
12
+ # billTo - AddressType
13
+ # shipTo - AddressType
14
+ # shipFrom - AddressType
15
+ # lineItem - InvoiceRequestType::LineItem
16
+ class InvoiceRequest < ComplexExactorObject
17
+
18
+ # inner class for member: LineItem
19
+ # {http://www.exactor.com/ns}LineItem
20
+ # sKU - SOAP::SOAPString
21
+ # description - SOAP::SOAPString
22
+ # quantity - SOAP::SOAPDecimal
23
+ # grossAmount - SOAP::SOAPDecimal
24
+ # taxDirection - TaxDirectionType
25
+ # billTo - AddressType
26
+ # shipTo - AddressType
27
+ # shipFrom - AddressType
28
+ # xmlattr_id - SOAP::SOAPID
29
+ class LineItem < ComplexExactorObject
30
+ AttrId = "id"
31
+
32
+ attr_accessor :SKU
33
+ attr_accessor :Description
34
+ attr_accessor :Quantity
35
+ attr_accessor :GrossAmount
36
+ attr_accessor :TaxDirection
37
+ attr_accessor :BillTo
38
+ attr_accessor :ShipTo
39
+ attr_accessor :ShipFrom
40
+
41
+ def __xmlattr
42
+ @__xmlattr ||= {}
43
+ end
44
+
45
+ def xmlattr_id
46
+ __xmlattr[AttrId]
47
+ end
48
+
49
+ def xmlattr_id=(value)
50
+ __xmlattr[AttrId] = value
51
+ end
52
+
53
+ def initialize(sKU = nil, description = nil, quantity = nil, grossAmount = nil, taxDirection = nil, billTo = nil, shipTo = nil, shipFrom = nil)
54
+ @SKU = sKU
55
+ @Description = description
56
+ @Quantity = quantity
57
+ @GrossAmount = grossAmount
58
+ @TaxDirection = taxDirection
59
+ @BillTo = billTo
60
+ @ShipTo = shipTo
61
+ @ShipFrom = shipFrom
62
+ @__xmlattr = {}
63
+ end
64
+ end
65
+
66
+ attr_accessor :SaleDate
67
+ attr_accessor :PurchaseOrderNumber
68
+ attr_accessor :CurrencyCode
69
+ attr_accessor :TaxClass
70
+ attr_accessor :TaxDirection
71
+ attr_accessor :ExemptionId
72
+ attr_accessor :BillTo
73
+ attr_accessor :ShipTo
74
+ attr_accessor :ShipFrom
75
+ attr_accessor :LineItem
76
+
77
+ def initialize(saleDate = nil, purchaseOrderNumber = nil, currencyCode = nil, taxClass = nil, taxDirection = nil, exemptionId = nil, billTo = nil, shipTo = nil, shipFrom = nil, lineItem = nil)
78
+ @SaleDate = saleDate
79
+ @PurchaseOrderNumber = purchaseOrderNumber
80
+ @CurrencyCode = currencyCode
81
+ @TaxClass = taxClass
82
+ @TaxDirection = taxDirection
83
+ @ExemptionId = exemptionId
84
+ @BillTo = billTo
85
+ @ShipTo = shipTo
86
+ @ShipFrom = shipFrom
87
+ @LineItem = lineItem
88
+ end
89
+ end
90
+
91
+ # {http://www.exactor.com/ns}CommitRequestType
92
+ # commitDate - SOAP::SOAPDate
93
+ # invoiceNumber - SOAP::SOAPString
94
+ # invoiceRequest - InvoiceRequestType
95
+ # priorTransactionId - SOAP::SOAPString
96
+ class CommitRequest <ComplexExactorObject
97
+ attr_accessor :CommitDate
98
+ attr_accessor :InvoiceNumber
99
+ attr_accessor :InvoiceRequest
100
+ attr_accessor :PriorTransactionId
101
+
102
+ def initialize(commitDate = nil, invoiceNumber = nil, invoiceRequest = nil, priorTransactionId = nil)
103
+ @CommitDate = commitDate
104
+ @InvoiceNumber = invoiceNumber
105
+ @InvoiceRequest = invoiceRequest
106
+ @PriorTransactionId = priorTransactionId
107
+ end
108
+ end
109
+
110
+ # {http://www.exactor.com/ns}RefundRequestType
111
+ # refundDate - SOAP::SOAPDate
112
+ # priorTransactionId - SOAP::SOAPString
113
+ class RefundRequest < ComplexExactorObject
114
+ attr_accessor :RefundDate
115
+ attr_accessor :PriorTransactionId
116
+
117
+ def initialize(refundDate = nil, priorTransactionId = nil)
118
+ @RefundDate = refundDate
119
+ @PriorTransactionId = priorTransactionId
120
+ end
121
+ end
122
+
123
+ # {http://www.exactor.com/ns}DeleteRequestType
124
+ # priorTransactionId - SOAP::SOAPString
125
+ class DeleteRequest < ComplexExactorObject
126
+ attr_accessor :PriorTransactionId
127
+
128
+ def initialize(priorTransactionId = nil)
129
+ @PriorTransactionId = priorTransactionId
130
+ end
131
+ end
132
+
133
+
134
+
135
+ # {http://www.exactor.com/ns}AddressType
136
+ # fullName - SOAP::SOAPString
137
+ # street1 - SOAP::SOAPString
138
+ # street2 - SOAP::SOAPString
139
+ # city - SOAP::SOAPString
140
+ # county - SOAP::SOAPString
141
+ # stateOrProvince - SOAP::SOAPString
142
+ # postalCode - SOAP::SOAPString
143
+ # country - SOAP::SOAPString
144
+ class AddressType < ComplexExactorObject
145
+ attr_accessor :FullName
146
+ attr_accessor :Street1
147
+ attr_accessor :Street2
148
+ attr_accessor :City
149
+ attr_accessor :County
150
+ attr_accessor :StateOrProvince
151
+ attr_accessor :PostalCode
152
+ attr_accessor :Country
153
+
154
+ def initialize(fullName = nil, street1 = nil, street2 = nil, city = nil, county = nil, stateOrProvince = nil, postalCode = nil, country = nil)
155
+ @FullName = fullName
156
+ @Street1 = street1
157
+ @Street2 = street2
158
+ @City = city
159
+ @County = county
160
+ @StateOrProvince = stateOrProvince
161
+ @PostalCode = postalCode
162
+ @Country = country
163
+ end
164
+ end
165
+
166
+ # {http://www.exactor.com/ns}TaxInfoType
167
+ # authorityLevel - AuthorityLevelType
168
+ # authorityName - SOAP::SOAPString
169
+ # cityOrCountyOrDistrict - SOAP::SOAPString
170
+ # stateOrProvince - SOAP::SOAPString
171
+ # country - SOAP::SOAPString
172
+ # taxAmount - SOAP::SOAPDecimal
173
+ # taxRate - SOAP::SOAPDecimal
174
+ class TaxInfoType < ComplexExactorObject
175
+ attr_accessor :AuthorityLevel
176
+ attr_accessor :AuthorityName
177
+ attr_accessor :CityOrCountyOrDistrict
178
+ attr_accessor :StateOrProvince
179
+ attr_accessor :Country
180
+ attr_accessor :TaxAmount
181
+ attr_accessor :TaxRate
182
+
183
+ def initialize(authorityLevel = nil, authorityName = nil, cityOrCountyOrDistrict = nil, stateOrProvince = nil, country = nil, taxAmount = nil, taxRate = nil)
184
+ @AuthorityLevel = authorityLevel
185
+ @AuthorityName = authorityName
186
+ @CityOrCountyOrDistrict = cityOrCountyOrDistrict
187
+ @StateOrProvince = stateOrProvince
188
+ @Country = country
189
+ @TaxAmount = taxAmount
190
+ @TaxRate = taxRate
191
+ end
192
+ end
193
+
194
+ # {http://www.exactor.com/ns}AuthorityLevelType
195
+ class AuthorityLevelType < ::String
196
+ City = new("City")
197
+ Country = new("Country")
198
+ County = new("County")
199
+ District = new("District")
200
+ StateOrProvince = new("StateOrProvince")
201
+ end
202
+
203
+ # {http://www.exactor.com/ns}CurrencyCodeType
204
+ class CurrencyCodeType < ::String
205
+ AED = new("AED")
206
+ AMD = new("AMD")
207
+ ARS = new("ARS")
208
+ AUD = new("AUD")
209
+ AZN = new("AZN")
210
+ BAM = new("BAM")
211
+ BDT = new("BDT")
212
+ BGN = new("BGN")
213
+ BHD = new("BHD")
214
+ BND = new("BND")
215
+ BOB = new("BOB")
216
+ BRL = new("BRL")
217
+ BWP = new("BWP")
218
+ CAD = new("CAD")
219
+ CHF = new("CHF")
220
+ CLP = new("CLP")
221
+ CNY = new("CNY")
222
+ COP = new("COP")
223
+ CRC = new("CRC")
224
+ CZK = new("CZK")
225
+ DKK = new("DKK")
226
+ DZD = new("DZD")
227
+ EEK = new("EEK")
228
+ EGP = new("EGP")
229
+ ETB = new("ETB")
230
+ EUR = new("EUR")
231
+ GBP = new("GBP")
232
+ GEL = new("GEL")
233
+ GTQ = new("GTQ")
234
+ HKD = new("HKD")
235
+ HRK = new("HRK")
236
+ HUF = new("HUF")
237
+ IDR = new("IDR")
238
+ ILS = new("ILS")
239
+ INR = new("INR")
240
+ IQD = new("IQD")
241
+ JPY = new("JPY")
242
+ KPW = new("KPW")
243
+ KWD = new("KWD")
244
+ KZT = new("KZT")
245
+ LTL = new("LTL")
246
+ LVL = new("LVL")
247
+ MAD = new("MAD")
248
+ MXN = new("MXN")
249
+ MYR = new("MYR")
250
+ NGN = new("NGN")
251
+ NOK = new("NOK")
252
+ NZD = new("NZD")
253
+ OMR = new("OMR")
254
+ PAB = new("PAB")
255
+ PEN = new("PEN")
256
+ PHP = new("PHP")
257
+ PKR = new("PKR")
258
+ PLN = new("PLN")
259
+ QAR = new("QAR")
260
+ RON = new("RON")
261
+ RSD = new("RSD")
262
+ RUB = new("RUB")
263
+ SAR = new("SAR")
264
+ SEK = new("SEK")
265
+ SGD = new("SGD")
266
+ SVC = new("SVC")
267
+ THB = new("THB")
268
+ TND = new("TND")
269
+ TRY = new("TRY")
270
+ TWD = new("TWD")
271
+ UAH = new("UAH")
272
+ USD = new("USD")
273
+ UYU = new("UYU")
274
+ UZS = new("UZS")
275
+ VEF = new("VEF")
276
+ VND = new("VND")
277
+ ZAR = new("ZAR")
278
+ end
279
+
280
+ # {http://www.exactor.com/ns}TaxClassType
281
+ class TaxClassType < ::String
282
+ Sales = new("Sales")
283
+ Use = new("Use")
284
+ end
285
+
286
+ # {http://www.exactor.com/ns}TaxDirectionType
287
+ class TaxDirectionType < ::String
288
+ Forward = new("Forward")
289
+ Reverse = new("Reverse")
290
+ end
291
+
292
+ # {http://www.exactor.com/ns}TaxObligationType
293
+ class TaxObligationType < ::String
294
+ Full = new("Full")
295
+ None = new("None")
296
+ Partial = new("Partial")
297
+ end
298
+
299
+ # {http://www.exactor.com/ns}TaxRequest
300
+ # merchantId - SOAP::SOAPString
301
+ # userId - SOAP::SOAPString
302
+ # partnerId - SOAP::SOAPString
303
+ # digitalSignature - SOAP::SOAPBase64
304
+ # invoiceRequest - InvoiceRequestType
305
+ # commitRequest - CommitRequestType
306
+ # refundRequest - RefundRequestType
307
+ # deleteRequest - DeleteRequestType
308
+ # xmlattr_plugin - SOAP::SOAPString
309
+ # xmlattr_version - SOAP::SOAPString
310
+ class TaxRequest < ComplexExactorObject
311
+ AttrPlugin = "plugin"
312
+ AttrVersion = "version"
313
+
314
+ attr_accessor :MerchantId
315
+ attr_accessor :UserId
316
+ attr_accessor :PartnerId
317
+ attr_accessor :DigitalSignature
318
+ attr_accessor :InvoiceRequest
319
+ attr_accessor :CommitRequest
320
+ attr_accessor :RefundRequest
321
+ attr_accessor :DeleteRequest
322
+
323
+ def __xmlattr
324
+ @__xmlattr ||= {}
325
+ end
326
+
327
+ def xmlattr_plugin
328
+ __xmlattr[AttrPlugin]
329
+ end
330
+
331
+ def xmlattr_plugin=(value)
332
+ __xmlattr[AttrPlugin] = value
333
+ end
334
+
335
+ def xmlattr_version
336
+ __xmlattr[AttrVersion]
337
+ end
338
+
339
+ def xmlattr_version=(value)
340
+ __xmlattr[AttrVersion] = value
341
+ end
342
+
343
+ def initialize(merchantId = nil, userId = nil, partnerId = nil, digitalSignature = nil, invoiceRequest = nil, commitRequest = nil, refundRequest = nil, deleteRequest = nil)
344
+ @MerchantId = merchantId
345
+ @UserId = userId
346
+ @PartnerId = partnerId
347
+ @DigitalSignature = digitalSignature
348
+ @InvoiceRequest = invoiceRequest
349
+ @CommitRequest = commitRequest
350
+ @RefundRequest = refundRequest
351
+ @DeleteRequest = deleteRequest
352
+ @__xmlattr = {"xmlns"=>"http://www.exactor.com/ns"}
353
+ end
354
+ end
355
+
356
+ class ExactorResponse
357
+ attr_accessor :is_valid
358
+ end
359
+
360
+ class CalculationResponse < ExactorResponse
361
+ attr_accessor :total_tax, :invoice_id
362
+
363
+ def initialize
364
+ @line_items = {}
365
+ end
366
+
367
+ def add_line_item(id, inline_tax)
368
+ @line_items[id]=inline_tax
369
+ end
370
+
371
+ def get_line_item_tax(id)
372
+ return @line_items[id]
373
+ end
374
+ end
375
+
376
+ class ErrorResponse < ExactorResponse
377
+ attr_accessor :error_code, :error_description
378
+ end
379
+
380
+ class CommitResponse < ExactorResponse
381
+ attr_accessor :commit_id, :invoice
382
+ end
383
+
384
+ class RefundResponse < ExactorResponse
385
+
386
+ end
387
+