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 +1 -1
- data/google4r-checkout.gemspec +1 -1
- data/lib/google4r/checkout/commands.rb +26 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.9
|
data/google4r-checkout.gemspec
CHANGED
@@ -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
|