./lib/venice/client.rb in venice-0.4.2 vs ./lib/venice/client.rb in venice-0.4.3
- old
+ new
@@ -44,9 +44,11 @@
# From Apple docs:
# > Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.
# > The JSON representation of the receipt for the most recent renewal
if latest_receipt_info_attributes = json['latest_receipt_info']
+ latest_receipt_info_attributes = [latest_receipt_info_attributes] if latest_receipt_info_attributes.is_a?(Hash)
+
# AppStore returns 'latest_receipt_info' even if we use over iOS 6. Besides, its format is an Array.
receipt.latest_receipt_info = []
latest_receipt_info_attributes.each do |latest_receipt_info_attribute|
# latest_receipt_info format is identical with in_app
receipt.latest_receipt_info << InAppReceipt.new(latest_receipt_info_attribute)