google4r-checkout 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +6 -2
- data/lib/google4r/checkout/notifications.rb +15 -15
- data/test/unit/add_merchant_order_number_command_test.rb +1 -141
- data/test/unit/add_tracking_data_command_test.rb +0 -150
- data/test/unit/archive_order_command_test.rb +0 -132
- data/test/unit/authorization_amount_notification_test.rb +0 -138
- data/test/unit/authorize_order_command_test.rb +0 -132
- data/test/unit/chargeback_amount_notification_test.rb +0 -130
- data/test/unit/refund_amount_notification_test.rb +0 -130
- data/test/unit/refund_order_command_test.rb +0 -172
- data/test/unit/send_buyer_message_command_test.rb +0 -146
- data/test/unit/unarchive_order_command_test.rb +0 -132
- metadata +3 -3
data/CHANGES
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
=
|
1
|
+
=google4r-checkout Changelog
|
2
|
+
|
3
|
+
== 1.0.1 (2007-08-16)
|
4
|
+
|
5
|
+
* Fixed text.to_s.gsub(/[^0-9]/, '') to (...text.to_f*100).to_i so dollar amount is now handled correctly
|
2
6
|
|
3
7
|
== 1.0.0 (2007-08-04)
|
4
8
|
|
@@ -51,4 +55,4 @@
|
|
51
55
|
|
52
56
|
== 0.0.1 (2007-02-17)
|
53
57
|
|
54
|
-
* initial release, be prepared for some API changes that move the API closer to the XML API
|
58
|
+
* initial release, be prepared for some API changes that move the API closer to the XML API
|
@@ -206,8 +206,8 @@ module Google4R #:nodoc:
|
|
206
206
|
result.order_adjustment = OrderAdjustment.create_from_element(element.elements['order-adjustment'])
|
207
207
|
result.shopping_cart = ShoppingCart.create_from_element(element.elements['shopping-cart'], result)
|
208
208
|
|
209
|
-
amount = element.elements['order-total'].text.
|
210
|
-
currency = element.elements['order-total'].attributes['currency']
|
209
|
+
amount = (element.elements['order-total'].text.to_f*100).to_i
|
210
|
+
currency = element.elements['order-total'].attributes['currency']
|
211
211
|
result.order_total = Money.new(amount, currency)
|
212
212
|
|
213
213
|
return result
|
@@ -319,12 +319,12 @@ module Google4R #:nodoc:
|
|
319
319
|
charge.serial_number = element.attributes['serial-number']
|
320
320
|
charge.google_order_number = element.elements['google-order-number'].text
|
321
321
|
|
322
|
-
currency = element.elements['latest-charge-amount'].attributes['currency']
|
323
|
-
amount = element.elements['latest-charge-amount'].text.to_f*100.
|
322
|
+
currency = element.elements['latest-charge-amount'].attributes['currency']
|
323
|
+
amount = (element.elements['latest-charge-amount'].text.to_f*100).to_i
|
324
324
|
charge.latest_charge_amount = Money.new(amount, currency)
|
325
325
|
|
326
326
|
currency = element.elements['total-charge-amount'].attributes['currency']
|
327
|
-
amount = element.elements['total-charge-amount'].text.to_f*100.
|
327
|
+
amount = (element.elements['total-charge-amount'].text.to_f*100).to_i
|
328
328
|
charge.total_charge_amount = Money.new(amount, currency)
|
329
329
|
|
330
330
|
charge.timestamp = Time.parse(element.elements['timestamp'].text)
|
@@ -372,11 +372,11 @@ module Google4R #:nodoc:
|
|
372
372
|
refund.google_order_number = element.elements['google-order-number'].text
|
373
373
|
|
374
374
|
currency = element.elements['latest-refund-amount'].attributes['currency']
|
375
|
-
amount = element.elements['latest-refund-amount'].text.to_f*100.
|
375
|
+
amount = (element.elements['latest-refund-amount'].text.to_f*100).to_i
|
376
376
|
refund.latest_refund_amount = Money.new(amount, currency)
|
377
377
|
|
378
378
|
currency = element.elements['total-refund-amount'].attributes['currency']
|
379
|
-
amount = element.elements['total-refund-amount'].text.to_f*100.
|
379
|
+
amount = (element.elements['total-refund-amount'].text.to_f*100).to_i
|
380
380
|
refund.total_refund_amount = Money.new(amount, currency)
|
381
381
|
|
382
382
|
refund.timestamp = Time.parse(element.elements['timestamp'].text)
|
@@ -425,11 +425,11 @@ module Google4R #:nodoc:
|
|
425
425
|
chargeback.google_order_number = element.elements['google-order-number'].text
|
426
426
|
|
427
427
|
currency = element.elements['latest-chargeback-amount'].attributes['currency']
|
428
|
-
amount = element.elements['latest-chargeback-amount'].text.to_f*100.
|
428
|
+
amount = (element.elements['latest-chargeback-amount'].text.to_f*100).to_i
|
429
429
|
chargeback.latest_chargeback_amount = Money.new(amount, currency)
|
430
430
|
|
431
431
|
currency = element.elements['total-chargeback-amount'].attributes['currency']
|
432
|
-
amount = element.elements['total-chargeback-amount'].text.to_f*100.
|
432
|
+
amount = (element.elements['total-chargeback-amount'].text.to_f*100).to_i
|
433
433
|
chargeback.total_chargeback_amount = Money.new(amount, currency)
|
434
434
|
|
435
435
|
chargeback.timestamp = Time.parse(element.elements['timestamp'].text)
|
@@ -484,7 +484,7 @@ module Google4R #:nodoc:
|
|
484
484
|
authorization.google_order_number = element.elements['google-order-number'].text
|
485
485
|
|
486
486
|
currency = element.elements['authorization-amount'].attributes['currency']
|
487
|
-
amount = element.elements['authorization-amount'].text.to_f*100.
|
487
|
+
amount = (element.elements['authorization-amount'].text.to_f*100).to_i
|
488
488
|
authorization.authorization_amount = Money.new(amount, currency)
|
489
489
|
|
490
490
|
authorization.authorization_expiration_date = Time.parse(element.elements['authorization-expiration-date'].text)
|
@@ -694,11 +694,11 @@ module Google4R #:nodoc:
|
|
694
694
|
|
695
695
|
result.code = element.elements['code'].text
|
696
696
|
|
697
|
-
amount = element.elements['calculated-amount'].text.
|
697
|
+
amount = (element.elements['calculated-amount'].text.to_f*100).to_i rescue nil
|
698
698
|
currency = element.elements['calculated-amount'].attributes['currency'] rescue nil
|
699
699
|
result.calculated_amount = Money.new(amount, currency) unless amount.nil?
|
700
700
|
|
701
|
-
amount = element.elements['applied-amount'].text.
|
701
|
+
amount = (element.elements['applied-amount'].text.to_f*100).to_i
|
702
702
|
currency = element.elements['applied-amount'].attributes['currency']
|
703
703
|
result.applied_amount = Money.new(amount, currency)
|
704
704
|
|
@@ -744,7 +744,7 @@ module Google4R #:nodoc:
|
|
744
744
|
|
745
745
|
result.name = element.elements['shipping-name'].text
|
746
746
|
|
747
|
-
amount = element.elements['shipping-cost'].text.
|
747
|
+
amount = (element.elements['shipping-cost'].text.to_f*100).to_i
|
748
748
|
currency = element.elements['shipping-cost'].attributes['currency']
|
749
749
|
result.cost = Money.new(amount, currency)
|
750
750
|
|
@@ -776,7 +776,7 @@ module Google4R #:nodoc:
|
|
776
776
|
def self.create_from_element(element)
|
777
777
|
result = OrderAdjustment.new
|
778
778
|
|
779
|
-
amount = element.elements['total-tax'].text.
|
779
|
+
amount = (element.elements['total-tax'].text.to_f*100).to_i rescue nil
|
780
780
|
currency = element.elements['total-tax'].attributes['currency'] rescue nil
|
781
781
|
result.total_tax = Money.new(amount, currency) unless amount.nil?
|
782
782
|
|
@@ -788,7 +788,7 @@ module Google4R #:nodoc:
|
|
788
788
|
|
789
789
|
result.merchant_calculation_successful = (element.elements['merchant-calculation-successful'].text.downcase == 'true') rescue nil
|
790
790
|
|
791
|
-
amount = element.elements['adjustment-total'].text.
|
791
|
+
amount = (element.elements['adjustment-total'].text.to_f*100).to_i rescue nil
|
792
792
|
currency = element.elements['adjustment-total'].attributes['currency'] rescue nil
|
793
793
|
result.adjustment_total = Money.new(amount, currency) unless amount.nil?
|
794
794
|
|
@@ -31,147 +31,7 @@ require 'google4r/checkout'
|
|
31
31
|
|
32
32
|
require 'test/frontend_configuration'
|
33
33
|
|
34
|
-
# Tests for the AddMerchantOrderNumberCommand class.
|
35
|
-
class Google4R::Checkout::AddMerchantOrderNumberCommandTest < Test::Unit::TestCase
|
36
|
-
include Google4R::Checkout
|
37
|
-
|
38
|
-
def setup
|
39
|
-
@frontend = Frontend.new(FRONTEND_CONFIGURATION)
|
40
|
-
@command = @frontend.create_add_merchant_order_number_command
|
41
|
-
|
42
|
-
@command.google_order_number = '841171949013218'
|
43
|
-
@command.merchant_order_number = 'P6502-53-7861SBJD'
|
44
|
-
|
45
|
-
@sample_xml=%Q{<?xml version='1.0' encoding='UTF-8'?>
|
46
|
-
<add-merchant-order-number xmlns='http://checkout.google.com/schema/2' google-order-number='841171949013218'>
|
47
|
-
<merchant-order-number>P6502-53-7861SBJD</merchant-order-number>
|
48
|
-
</add-merchant-order-number>}
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_behaves_correctly
|
52
|
-
[ :google_order_number, :merchant_order_number ].each do |symbol|
|
53
|
-
assert_respond_to @command, symbol
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_xml
|
58
|
-
assert_strings_equal(@sample_xml, @command.to_xml)
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_accessors
|
62
|
-
assert_equal('841171949013218', @command.google_order_number)
|
63
|
-
assert_equal('P6502-53-7861SBJD', @command.merchant_order_number)
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_to_xml_does_not_raise_exception
|
67
|
-
assert_nothing_raised { @command.to_xml }
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
#--
|
72
|
-
# Project: google_checkout4r
|
73
|
-
# File: test/unit/add_merchant_order_number_command_test.rb
|
74
|
-
# Author: Tony Chan <api.htchan at gmail dot com>
|
75
|
-
# Copyright: (c) 2007 by Tony Chan
|
76
|
-
# License: MIT License as follows:
|
77
|
-
#
|
78
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
79
|
-
# a copy of this software and associated documentation files (the
|
80
|
-
# "Software"), to deal in the Software without restriction, including
|
81
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
82
|
-
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
83
|
-
# persons to whom the Software is furnished to do so, subject to the
|
84
|
-
# following conditions:
|
85
|
-
#
|
86
|
-
# The above copyright notice and this permission notice shall be included
|
87
|
-
# in all copies or substantial portions of the Software.
|
88
|
-
#
|
89
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
90
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
91
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
92
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
93
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
94
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
95
|
-
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
96
|
-
#++
|
97
|
-
|
98
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
99
|
-
|
100
|
-
require 'google4r/checkout'
|
101
|
-
|
102
|
-
require 'test/frontend_configuration'
|
103
|
-
|
104
|
-
# Tests for the AddMerchantOrderNumberCommand class.
|
105
|
-
class Google4R::Checkout::AddMerchantOrderNumberCommandTest < Test::Unit::TestCase
|
106
|
-
include Google4R::Checkout
|
107
|
-
|
108
|
-
def setup
|
109
|
-
@frontend = Frontend.new(FRONTEND_CONFIGURATION)
|
110
|
-
@command = @frontend.create_add_merchant_order_number_command
|
111
|
-
|
112
|
-
@command.google_order_number = '841171949013218'
|
113
|
-
@command.merchant_order_number = 'P6502-53-7861SBJD'
|
114
|
-
|
115
|
-
@sample_xml=%Q{<?xml version='1.0' encoding='UTF-8'?>
|
116
|
-
<add-merchant-order-number xmlns='http://checkout.google.com/schema/2' google-order-number='841171949013218'>
|
117
|
-
<merchant-order-number>P6502-53-7861SBJD</merchant-order-number>
|
118
|
-
</add-merchant-order-number>}
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_behaves_correctly
|
122
|
-
[ :google_order_number, :merchant_order_number ].each do |symbol|
|
123
|
-
assert_respond_to @command, symbol
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
def test_xml
|
128
|
-
assert_strings_equal(@sample_xml, @command.to_xml)
|
129
|
-
end
|
130
|
-
|
131
|
-
def test_accessors
|
132
|
-
assert_equal('841171949013218', @command.google_order_number)
|
133
|
-
assert_equal('P6502-53-7861SBJD', @command.merchant_order_number)
|
134
|
-
end
|
135
|
-
|
136
|
-
def test_to_xml_does_not_raise_exception
|
137
|
-
assert_nothing_raised { @command.to_xml }
|
138
|
-
end
|
139
|
-
|
140
|
-
end
|
141
|
-
#--
|
142
|
-
# Project: google_checkout4r
|
143
|
-
# File: test/unit/add_merchant_order_number_command_test.rb
|
144
|
-
# Author: Tony Chan <api.htchan at gmail dot com>
|
145
|
-
# Copyright: (c) 2007 by Tony Chan
|
146
|
-
# License: MIT License as follows:
|
147
|
-
#
|
148
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
149
|
-
# a copy of this software and associated documentation files (the
|
150
|
-
# "Software"), to deal in the Software without restriction, including
|
151
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
152
|
-
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
153
|
-
# persons to whom the Software is furnished to do so, subject to the
|
154
|
-
# following conditions:
|
155
|
-
#
|
156
|
-
# The above copyright notice and this permission notice shall be included
|
157
|
-
# in all copies or substantial portions of the Software.
|
158
|
-
#
|
159
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
160
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
161
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
162
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
163
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
164
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
165
|
-
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
166
|
-
#++
|
167
|
-
|
168
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
169
|
-
|
170
|
-
require 'google4r/checkout'
|
171
|
-
|
172
|
-
require 'test/frontend_configuration'
|
173
|
-
|
174
|
-
# Tests for the AddMerchantOrderNumberCommand class.
|
34
|
+
# Tests for the AddMerchantOrderNumberCommand class.
|
175
35
|
class Google4R::Checkout::AddMerchantOrderNumberCommandTest < Test::Unit::TestCase
|
176
36
|
include Google4R::Checkout
|
177
37
|
|
@@ -31,156 +31,6 @@ require 'google4r/checkout'
|
|
31
31
|
|
32
32
|
require 'test/frontend_configuration'
|
33
33
|
|
34
|
-
# Tests for the AddTrackingDataCommand class.
|
35
|
-
class Google4R::Checkout::AddTrackingDataCommandTest < Test::Unit::TestCase
|
36
|
-
include Google4R::Checkout
|
37
|
-
|
38
|
-
def setup
|
39
|
-
@frontend = Frontend.new(FRONTEND_CONFIGURATION)
|
40
|
-
@command = @frontend.create_add_tracking_data_command
|
41
|
-
|
42
|
-
@command.google_order_number = '841171949013218'
|
43
|
-
@command.carrier = 'UPS'
|
44
|
-
@command.tracking_number = 'Z9842W69871281267'
|
45
|
-
|
46
|
-
@sample_xml=%Q{<?xml version='1.0' encoding='UTF-8'?>
|
47
|
-
<add-tracking-data xmlns='http://checkout.google.com/schema/2' google-order-number='841171949013218'>
|
48
|
-
<tracking-data>
|
49
|
-
<carrier>UPS</carrier>
|
50
|
-
<tracking-number>Z9842W69871281267</tracking-number>
|
51
|
-
</tracking-data>
|
52
|
-
</add-tracking-data>}
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_behaves_correctly
|
56
|
-
[ :google_order_number, :carrier, :tracking_number ].each do |symbol|
|
57
|
-
assert_respond_to @command, symbol
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_xml
|
62
|
-
assert_strings_equal(@sample_xml, @command.to_xml)
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_accessors
|
66
|
-
assert_equal('841171949013218', @command.google_order_number)
|
67
|
-
assert_equal('Z9842W69871281267', @command.tracking_number)
|
68
|
-
assert_equal('UPS', @command.carrier)
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_to_xml_does_not_raise_exception
|
72
|
-
assert_nothing_raised { @command.to_xml }
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
#--
|
77
|
-
# Project: google_checkout4r
|
78
|
-
# File: test/unit/add_tracking_data_command_test.rb
|
79
|
-
# Author: Tony Chan <api.htchan at gmail dot com>
|
80
|
-
# Copyright: (c) 2007 by Tony Chan
|
81
|
-
# License: MIT License as follows:
|
82
|
-
#
|
83
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
84
|
-
# a copy of this software and associated documentation files (the
|
85
|
-
# "Software"), to deal in the Software without restriction, including
|
86
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
87
|
-
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
88
|
-
# persons to whom the Software is furnished to do so, subject to the
|
89
|
-
# following conditions:
|
90
|
-
#
|
91
|
-
# The above copyright notice and this permission notice shall be included
|
92
|
-
# in all copies or substantial portions of the Software.
|
93
|
-
#
|
94
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
95
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
96
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
97
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
98
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
99
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
100
|
-
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
101
|
-
#++
|
102
|
-
|
103
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
104
|
-
|
105
|
-
require 'google4r/checkout'
|
106
|
-
|
107
|
-
require 'test/frontend_configuration'
|
108
|
-
|
109
|
-
# Tests for the AddTrackingDataCommand class.
|
110
|
-
class Google4R::Checkout::AddTrackingDataCommandTest < Test::Unit::TestCase
|
111
|
-
include Google4R::Checkout
|
112
|
-
|
113
|
-
def setup
|
114
|
-
@frontend = Frontend.new(FRONTEND_CONFIGURATION)
|
115
|
-
@command = @frontend.create_add_tracking_data_command
|
116
|
-
|
117
|
-
@command.google_order_number = '841171949013218'
|
118
|
-
@command.carrier = 'UPS'
|
119
|
-
@command.tracking_number = 'Z9842W69871281267'
|
120
|
-
|
121
|
-
@sample_xml=%Q{<?xml version='1.0' encoding='UTF-8'?>
|
122
|
-
<add-tracking-data xmlns='http://checkout.google.com/schema/2' google-order-number='841171949013218'>
|
123
|
-
<tracking-data>
|
124
|
-
<carrier>UPS</carrier>
|
125
|
-
<tracking-number>Z9842W69871281267</tracking-number>
|
126
|
-
</tracking-data>
|
127
|
-
</add-tracking-data>}
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_behaves_correctly
|
131
|
-
[ :google_order_number, :carrier, :tracking_number ].each do |symbol|
|
132
|
-
assert_respond_to @command, symbol
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
def test_xml
|
137
|
-
assert_strings_equal(@sample_xml, @command.to_xml)
|
138
|
-
end
|
139
|
-
|
140
|
-
def test_accessors
|
141
|
-
assert_equal('841171949013218', @command.google_order_number)
|
142
|
-
assert_equal('Z9842W69871281267', @command.tracking_number)
|
143
|
-
assert_equal('UPS', @command.carrier)
|
144
|
-
end
|
145
|
-
|
146
|
-
def test_to_xml_does_not_raise_exception
|
147
|
-
assert_nothing_raised { @command.to_xml }
|
148
|
-
end
|
149
|
-
|
150
|
-
end
|
151
|
-
#--
|
152
|
-
# Project: google_checkout4r
|
153
|
-
# File: test/unit/add_tracking_data_command_test.rb
|
154
|
-
# Author: Tony Chan <api.htchan at gmail dot com>
|
155
|
-
# Copyright: (c) 2007 by Tony Chan
|
156
|
-
# License: MIT License as follows:
|
157
|
-
#
|
158
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
159
|
-
# a copy of this software and associated documentation files (the
|
160
|
-
# "Software"), to deal in the Software without restriction, including
|
161
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
162
|
-
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
163
|
-
# persons to whom the Software is furnished to do so, subject to the
|
164
|
-
# following conditions:
|
165
|
-
#
|
166
|
-
# The above copyright notice and this permission notice shall be included
|
167
|
-
# in all copies or substantial portions of the Software.
|
168
|
-
#
|
169
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
170
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
171
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
172
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
173
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
174
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
175
|
-
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
176
|
-
#++
|
177
|
-
|
178
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
179
|
-
|
180
|
-
require 'google4r/checkout'
|
181
|
-
|
182
|
-
require 'test/frontend_configuration'
|
183
|
-
|
184
34
|
# Tests for the AddTrackingDataCommand class.
|
185
35
|
class Google4R::Checkout::AddTrackingDataCommandTest < Test::Unit::TestCase
|
186
36
|
include Google4R::Checkout
|
@@ -31,138 +31,6 @@ require 'google4r/checkout'
|
|
31
31
|
|
32
32
|
require 'test/frontend_configuration'
|
33
33
|
|
34
|
-
# Tests for the ArchiveOrderCommand class.
|
35
|
-
class Google4R::Checkout::ArchiveOrderCommandTest < Test::Unit::TestCase
|
36
|
-
include Google4R::Checkout
|
37
|
-
|
38
|
-
def setup
|
39
|
-
@frontend = Frontend.new(FRONTEND_CONFIGURATION)
|
40
|
-
@command = @frontend.create_archive_order_command
|
41
|
-
|
42
|
-
@command.google_order_number = '841171949013218'
|
43
|
-
|
44
|
-
@sample_xml=%Q{<?xml version='1.0' encoding='UTF-8'?>
|
45
|
-
<archive-order xmlns='http://checkout.google.com/schema/2' google-order-number='841171949013218'/>}
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_behaves_correctly
|
49
|
-
[ :google_order_number ].each do |symbol|
|
50
|
-
assert_respond_to @command, symbol
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_xml
|
55
|
-
assert_strings_equal(@sample_xml, @command.to_xml)
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_accessors
|
59
|
-
assert_equal('841171949013218', @command.google_order_number)
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_to_xml_does_not_raise_exception
|
63
|
-
assert_nothing_raised { @command.to_xml }
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
#--
|
68
|
-
# Project: google_checkout4r
|
69
|
-
# File: test/unit/archive_command_test.rb
|
70
|
-
# Author: Tony Chan <api.htchan at gmail dot com>
|
71
|
-
# Copyright: (c) 2007 by Tony Chan
|
72
|
-
# License: MIT License as follows:
|
73
|
-
#
|
74
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
75
|
-
# a copy of this software and associated documentation files (the
|
76
|
-
# "Software"), to deal in the Software without restriction, including
|
77
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
78
|
-
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
79
|
-
# persons to whom the Software is furnished to do so, subject to the
|
80
|
-
# following conditions:
|
81
|
-
#
|
82
|
-
# The above copyright notice and this permission notice shall be included
|
83
|
-
# in all copies or substantial portions of the Software.
|
84
|
-
#
|
85
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
86
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
87
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
88
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
89
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
90
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
91
|
-
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
92
|
-
#++
|
93
|
-
|
94
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
95
|
-
|
96
|
-
require 'google4r/checkout'
|
97
|
-
|
98
|
-
require 'test/frontend_configuration'
|
99
|
-
|
100
|
-
# Tests for the ArchiveOrderCommand class.
|
101
|
-
class Google4R::Checkout::ArchiveOrderCommandTest < Test::Unit::TestCase
|
102
|
-
include Google4R::Checkout
|
103
|
-
|
104
|
-
def setup
|
105
|
-
@frontend = Frontend.new(FRONTEND_CONFIGURATION)
|
106
|
-
@command = @frontend.create_archive_order_command
|
107
|
-
|
108
|
-
@command.google_order_number = '841171949013218'
|
109
|
-
|
110
|
-
@sample_xml=%Q{<?xml version='1.0' encoding='UTF-8'?>
|
111
|
-
<archive-order xmlns='http://checkout.google.com/schema/2' google-order-number='841171949013218'/>}
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_behaves_correctly
|
115
|
-
[ :google_order_number ].each do |symbol|
|
116
|
-
assert_respond_to @command, symbol
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
def test_xml
|
121
|
-
assert_strings_equal(@sample_xml, @command.to_xml)
|
122
|
-
end
|
123
|
-
|
124
|
-
def test_accessors
|
125
|
-
assert_equal('841171949013218', @command.google_order_number)
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_to_xml_does_not_raise_exception
|
129
|
-
assert_nothing_raised { @command.to_xml }
|
130
|
-
end
|
131
|
-
|
132
|
-
end
|
133
|
-
#--
|
134
|
-
# Project: google_checkout4r
|
135
|
-
# File: test/unit/archive_command_test.rb
|
136
|
-
# Author: Tony Chan <api.htchan at gmail dot com>
|
137
|
-
# Copyright: (c) 2007 by Tony Chan
|
138
|
-
# License: MIT License as follows:
|
139
|
-
#
|
140
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
141
|
-
# a copy of this software and associated documentation files (the
|
142
|
-
# "Software"), to deal in the Software without restriction, including
|
143
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
144
|
-
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
145
|
-
# persons to whom the Software is furnished to do so, subject to the
|
146
|
-
# following conditions:
|
147
|
-
#
|
148
|
-
# The above copyright notice and this permission notice shall be included
|
149
|
-
# in all copies or substantial portions of the Software.
|
150
|
-
#
|
151
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
152
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
153
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
154
|
-
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
155
|
-
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
156
|
-
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
157
|
-
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
158
|
-
#++
|
159
|
-
|
160
|
-
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
161
|
-
|
162
|
-
require 'google4r/checkout'
|
163
|
-
|
164
|
-
require 'test/frontend_configuration'
|
165
|
-
|
166
34
|
# Tests for the ArchiveOrderCommand class.
|
167
35
|
class Google4R::Checkout::ArchiveOrderCommandTest < Test::Unit::TestCase
|
168
36
|
include Google4R::Checkout
|