nbudin-google4r-checkout 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.8
1
+ 1.0.9
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{google4r-checkout}
8
- s.version = "1.0.8"
8
+ s.version = "1.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tony Chan"]
@@ -120,6 +120,10 @@ module Google4R #:nodoc:
120
120
  when 'request-received'
121
121
  serial_number = xml_doc.elements['/request-received'].attributes['serial-number']
122
122
  return serial_number
123
+ when 'subscription-request-received'
124
+ serial_number = xml_doc.root.elements['/subscription-request-received'].attributes['serial-number']
125
+ new_google_order_number = xml_doc.root.elements['/subscription-request-received'].attributes['new-google-order-number']
126
+ return SubscriptionRequestReceivedResponse.new(serial_number, new_google_order_number)
123
127
  else
124
128
  raise "Unknown response:\n--\n#{xml_doc.to_s}\n--"
125
129
  end
@@ -296,6 +300,28 @@ module Google4R #:nodoc:
296
300
  return @redirect_url
297
301
  end
298
302
  end
303
+
304
+ # SubscriptionRequestReceivedResponse instances are returned when a
305
+ # CreateOrderRecurrenceRequestCommand is successfully processed by Google Checkout.
306
+ class SubscriptionRequestReceivedResponse
307
+ # The serial number of the <subscription-request-received> response.
308
+ attr_reader :serial_number
309
+
310
+ # The new order number that was generated for this request.
311
+ attr_reader :new_google_order_number
312
+
313
+ # Create a new SubscriptionRequestReceivedResponse with the given serial number and Google
314
+ # order number. Do not create SubscriptionRequestReceivedResponse instances in your own
315
+ # code. Google4R creates them for you.
316
+ def initialize(serial_number, new_google_order_number)
317
+ @serial_number = serial_number
318
+ @new_google_order_number = new_google_order_number
319
+ end
320
+
321
+ def to_s
322
+ return @new_google_order_number
323
+ end
324
+ end
299
325
 
300
326
  #
301
327
  # The ChargeOrderCommand instructs Google Checkout to charge the buyer for a
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nbudin-google4r-checkout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Chan