Skip to content

Commit

Permalink
Merge pull request #1 from runtastic/Add_is_trial_period_to_in_app_re…
Browse files Browse the repository at this point in the history
…ceipt

Add is_trial_period to in_app_receipt
  • Loading branch information
doesterr committed Mar 21, 2016
2 parents 8849b15 + acded43 commit f9d5b85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/venice/in_app_receipt.rb
Expand Up @@ -40,6 +40,7 @@ class InAppReceipt
attr_reader :expires_date

attr_reader :web_order_line_item_id
attr_reader :is_trial_period

# For a transaction that was canceled by Apple customer support, the time and date of the cancellation.
attr_reader :cancellation_at
Expand All @@ -55,6 +56,7 @@ def initialize(attributes = {})
@app_item_id = attributes['app_item_id']
@web_order_line_item_id = attributes['web_order_line_item_id']
@version_external_identifier = attributes['version_external_identifier']
@is_trial_period = attributes['is_trial_period']

# expires_date is in ms since the Epoch, Time.at expects seconds
@expires_date = DateTime.parse(attributes['expires_date']) if attributes['expires_date']
Expand Down Expand Up @@ -84,7 +86,8 @@ def to_hash
:web_order_line_item_id => @web_order_line_item_id,
:version_external_identifier => @version_external_identifier,
:expires_date => (@expires_date.httpdate rescue nil),
:cancellation_at => (@cancellation_at.httpdate rescue nil)
:cancellation_at => (@cancellation_at.httpdate rescue nil),
:is_trial_period => (@is_trial_period rescue nil)
}
end
alias_method :to_h, :to_hash
Expand Down
2 changes: 1 addition & 1 deletion lib/venice/version.rb
@@ -1,3 +1,3 @@
module Venice
VERSION = "0.3.1.paperlesspost"
VERSION = "0.3.3"
end

0 comments on commit f9d5b85

Please sign in to comment.