google4r-checkout 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/README.md +1 -1
- data/lib/google4r/checkout/shared.rb +9 -4
- data/test/unit/command_test.rb +9 -1
- data/test/unit/notification_acknowledgement_test.rb +4 -6
- metadata +58 -77
- data/test/frontend_configuration_example.rb +0 -13
data/CHANGES
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
=google4r-checkout Changelog
|
2
2
|
|
3
|
+
== 1.1.1 (2011-12-16)
|
4
|
+
|
5
|
+
* Bug fix for subscriptions not being processed, contributed by Larry Salibra
|
6
|
+
* Automated testing with Travis
|
7
|
+
* Officially support JRuby
|
8
|
+
|
3
9
|
== 1.1.0 (2011-06-29)
|
4
10
|
|
5
11
|
* Support for newer refund-notification XML format, contributed by Chris Parrish
|
data/README.md
CHANGED
@@ -328,6 +328,11 @@ module Google4R #:nodoc:
|
|
328
328
|
result.create_digital_content(DigitalContent.create_from_element(digital_content_element))
|
329
329
|
end
|
330
330
|
|
331
|
+
subscription_element = element.elements['subscription']
|
332
|
+
if not subscription_element.nil?
|
333
|
+
result.create_subscription(Subscription.create_from_element(subscription_element))
|
334
|
+
end
|
335
|
+
|
331
336
|
return result
|
332
337
|
end
|
333
338
|
|
@@ -479,11 +484,11 @@ module Google4R #:nodoc:
|
|
479
484
|
result.start_date = Time.iso8601(element.attributes['start-date']) rescue nil
|
480
485
|
result.type = element.attributes['type'] rescue nil
|
481
486
|
|
482
|
-
element.elements
|
483
|
-
result.payments << SubscriptionPayment.create_from_element(
|
487
|
+
element.elements.each('payments/subscription-payment') do |payment_element|
|
488
|
+
result.payments << SubscriptionPayment.create_from_element(result, payment_element)
|
484
489
|
end
|
485
490
|
|
486
|
-
element.elements
|
491
|
+
element.elements.each('recurrent-item') do |item_element|
|
487
492
|
result.recurrent_items << Item.create_from_element(item_element)
|
488
493
|
end
|
489
494
|
|
@@ -521,7 +526,7 @@ module Google4R #:nodoc:
|
|
521
526
|
end
|
522
527
|
|
523
528
|
def self.create_from_element(subscription, element)
|
524
|
-
result = SubscriptionPayment.new
|
529
|
+
result = SubscriptionPayment.new(subscription)
|
525
530
|
result.subscription = subscription
|
526
531
|
result.times = element.attributes['times'].to_i rescue nil
|
527
532
|
|
data/test/unit/command_test.rb
CHANGED
@@ -56,7 +56,15 @@ class Google4R::Checkout::CommandTest < Test::Unit::TestCase
|
|
56
56
|
def test_sending_fails_if_certificate_validation_fails
|
57
57
|
OpenSSL::SSL::SSLSocket.any_instance.stubs(:connect).raises(OpenSSL::SSL::SSLError, 'certificate verify failed')
|
58
58
|
|
59
|
-
|
59
|
+
exc_type = case RUBY_PLATFORM
|
60
|
+
when "java"
|
61
|
+
# jruby-openssl throws an EOFError instead, for some reason
|
62
|
+
EOFError
|
63
|
+
else
|
64
|
+
OpenSSL::SSL::SSLError
|
65
|
+
end
|
66
|
+
|
67
|
+
assert_raise(exc_type) { @command.send_to_google_checkout }
|
60
68
|
end
|
61
69
|
|
62
70
|
def test_instantiate_abstract_class
|
@@ -52,16 +52,14 @@ class Google4R::Checkout::NotificationAcknowledgementTest < Test::Unit::TestCase
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_to_xml_works_as_expected
|
55
|
-
ack = NotificationAcknowledgement.new
|
56
|
-
|
57
|
-
assert_equal str, ack.to_xml
|
55
|
+
ack = Nokogiri.parse(NotificationAcknowledgement.new.to_xml).css('notification-acknowledgment').first
|
56
|
+
assert_equal "http://checkout.google.com/schema/2", ack.namespace.href
|
58
57
|
end
|
59
58
|
|
60
59
|
def test_to_xml_with_serial_number
|
61
60
|
root = REXML::Document.new(@example_xml).root
|
62
61
|
notification = ChargebackAmountNotification.create_from_element(root, @frontend)
|
63
|
-
ack = NotificationAcknowledgement.new(notification)
|
64
|
-
|
65
|
-
assert_equal str, ack.to_xml
|
62
|
+
ack = Nokogiri.parse(NotificationAcknowledgement.new(notification).to_xml).css('notification-acknowledgment').first
|
63
|
+
assert_equal "bea6bc1b-e1e2-44fe-80ff-0180e33a2614", ack.attr('serial-number')
|
66
64
|
end
|
67
65
|
end
|
metadata
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: google4r-checkout
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 1.1.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Tony Chan
|
14
9
|
- Dan Dukeson
|
15
10
|
- Nat Budin
|
@@ -17,68 +12,67 @@ authors:
|
|
17
12
|
- Daniel Higham
|
18
13
|
- Johnathan Niziol
|
19
14
|
- Chris Parrish
|
15
|
+
- Larry Salibra
|
20
16
|
autorequire:
|
21
17
|
bindir: bin
|
22
18
|
cert_chain: []
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
dependencies:
|
27
|
-
- !ruby/object:Gem::Dependency
|
19
|
+
date: 2011-12-16 00:00:00.000000000 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
28
22
|
name: money
|
29
|
-
|
30
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
requirement: &70330930056060 !ruby/object:Gem::Requirement
|
31
24
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
hash: 3
|
36
|
-
segments:
|
37
|
-
- 2
|
38
|
-
- 3
|
39
|
-
- 0
|
25
|
+
requirements:
|
26
|
+
- - ! '>='
|
27
|
+
- !ruby/object:Gem::Version
|
40
28
|
version: 2.3.0
|
41
29
|
type: :runtime
|
42
|
-
version_requirements: *id001
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: mocha
|
45
30
|
prerelease: false
|
46
|
-
|
31
|
+
version_requirements: *70330930056060
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: mocha
|
34
|
+
requirement: &70330930055680 !ruby/object:Gem::Requirement
|
47
35
|
none: false
|
48
|
-
requirements:
|
49
|
-
- -
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
|
52
|
-
segments:
|
53
|
-
- 0
|
54
|
-
version: "0"
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
55
40
|
type: :development
|
56
|
-
|
57
|
-
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: *70330930055680
|
43
|
+
- !ruby/object:Gem::Dependency
|
58
44
|
name: nokogiri
|
45
|
+
requirement: &70330930055080 !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :development
|
59
52
|
prerelease: false
|
60
|
-
|
53
|
+
version_requirements: *70330930055080
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rake
|
56
|
+
requirement: &70330930054460 !ruby/object:Gem::Requirement
|
61
57
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
segments:
|
67
|
-
- 0
|
68
|
-
version: "0"
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
69
62
|
type: :development
|
70
|
-
|
71
|
-
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: *70330930054460
|
65
|
+
description: ! " google4r-checkout is a lightweight, framework-agnostic Ruby library
|
66
|
+
to access the Google Checkout service and implement \n notification handlers. It
|
67
|
+
exposes object-oriented wrappers for all of Google Checkout's API commands and notifications.\n"
|
72
68
|
email: natbudin@gmail.com
|
73
69
|
executables: []
|
74
|
-
|
75
70
|
extensions: []
|
76
|
-
|
77
|
-
extra_rdoc_files:
|
71
|
+
extra_rdoc_files:
|
78
72
|
- README.md
|
79
73
|
- LICENSE
|
80
74
|
- CHANGES
|
81
|
-
files:
|
75
|
+
files:
|
82
76
|
- lib/google4r/checkout/commands.rb
|
83
77
|
- lib/google4r/checkout/frontend.rb
|
84
78
|
- lib/google4r/checkout/merchant_calculation.rb
|
@@ -153,47 +147,34 @@ files:
|
|
153
147
|
- test/unit/us_zip_area_test.rb
|
154
148
|
- test/unit/world_area_test.rb
|
155
149
|
- test/test_helper.rb
|
156
|
-
- test/frontend_configuration_example.rb
|
157
150
|
- README.md
|
158
151
|
- LICENSE
|
159
152
|
- CHANGES
|
160
|
-
has_rdoc: true
|
161
153
|
homepage: http://github.com/nbudin/google4r-checkout
|
162
154
|
licenses: []
|
163
|
-
|
164
155
|
post_install_message:
|
165
156
|
rdoc_options: []
|
166
|
-
|
167
|
-
require_paths:
|
157
|
+
require_paths:
|
168
158
|
- lib
|
169
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
160
|
none: false
|
171
|
-
requirements:
|
172
|
-
- -
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
hash: 63
|
175
|
-
segments:
|
176
|
-
- 1
|
177
|
-
- 8
|
178
|
-
- 4
|
161
|
+
requirements:
|
162
|
+
- - ! '>='
|
163
|
+
- !ruby/object:Gem::Version
|
179
164
|
version: 1.8.4
|
180
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
166
|
none: false
|
182
|
-
requirements:
|
183
|
-
- -
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
|
186
|
-
segments:
|
187
|
-
- 0
|
188
|
-
version: "0"
|
167
|
+
requirements:
|
168
|
+
- - ! '>='
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
189
171
|
requirements: []
|
190
|
-
|
191
172
|
rubyforge_project:
|
192
|
-
rubygems_version: 1.
|
173
|
+
rubygems_version: 1.8.12
|
193
174
|
signing_key:
|
194
175
|
specification_version: 3
|
195
176
|
summary: Full-featured Google Checkout library for Ruby
|
196
|
-
test_files:
|
177
|
+
test_files:
|
197
178
|
- test/integration/checkout_command_test.rb
|
198
179
|
- test/unit/add_merchant_order_number_command_test.rb
|
199
180
|
- test/unit/add_tracking_data_command_test.rb
|
@@ -259,4 +240,4 @@ test_files:
|
|
259
240
|
- test/unit/us_zip_area_test.rb
|
260
241
|
- test/unit/world_area_test.rb
|
261
242
|
- test/test_helper.rb
|
262
|
-
|
243
|
+
has_rdoc:
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Uncomment the following line if you are using Google Checkout in Great Britain
|
2
|
-
# and adjust it if you want to test google4r-checkout against any other (future)
|
3
|
-
# Google Checkout service.
|
4
|
-
|
5
|
-
# Money.default_currency = 'GBP'
|
6
|
-
|
7
|
-
# The test configuration for the Google4R::Checkout::Frontend class.
|
8
|
-
FRONTEND_CONFIGURATION =
|
9
|
-
{
|
10
|
-
:merchant_id => '',
|
11
|
-
:merchant_key => '',
|
12
|
-
:use_sandbox => true
|
13
|
-
}
|