-
Notifications
You must be signed in to change notification settings - Fork 71
Add support to ios 7 style grand unified receipts #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6a0b190
to
c6b3cd1
Compare
c6b3cd1
to
ce27aaf
Compare
ce27aaf
to
eedde53
Compare
2 similar comments
@zabolotnov87 Thanks for your work. It looks quite great. Maybe we should think about dropping support for the iOS6 style receipts at all. As also mentioned in #15: I'm currently in a situation where I cannot work on this project for a couple of weeks. I'm very sorry for this, but my family goes first. |
Any updates on this issue? |
|
||
# For a transaction that was cancelled, the reason for cancellation | ||
# @return [String] | ||
def cancellation_reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would make sense to keep the model as close to the response from Apple as possible?
Perhaps
def cancellation_reason
read_integer('cancellation_reason')
end
and
def cancellation_reason_string
code = read_integer('cancellation_reason')
code && CANCELATION_REASONS[code]
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And perhaps the same approach for
EXPIRATION_INTENTS = {
1 => 'Customer canceled their subscription.',
2 => 'Billing error; for example customer’s payment information'\
'was no longer valid.',
3 => 'Customer did not agree to a recent price increase.',
4 => 'Product was not available for purchase at the time of renewal.',
5 => 'Unknown error.'
}.freeze
# For an expired subscription, the reason for the
# subscription expiration.
# @return [Integer]
def expiration_intent
read_integer('expiration_intent')
end
# For an expired subscription, the reason for the
# subscription expiration.
# @return [String]
def expiration_intent_string
code = expiration_intent
code && EXPIRATION_INTENTS[code]
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach. I'm now back to the office and will start catching up all the issues in the next days and weeks.
def app_item_id | ||
read('app_item_id') | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add
# For an expired subscription, whether or not Apple is still attempting
# to automatically renew the subscription.
# @return [Integer]
def is_in_billing_retry_period
read_integer('is_in_billing_retry_period')
end
# The current renewal status for the auto-renewable subscription.
# @return [Integer]
def auto_renew_status
read_integer('auto_renew_status')
end
# The current renewal preference for the auto-renewable subscription.
# @return [String]
def auto_renew_product_id
read('auto_renew_product_id')
end
# The primary key for identifying subscription purchases.
# @return [String]
def web_order_line_item_id
read('web_order_line_item_id')
end
# The current price consent status for a subscription price increase.
# @return [Integer]
def price_consent_status
read_integer('price_consent_status')
end
Nice to have you back @jnbt. So, apparently these extra fields are presented outside of the receipt under the
We've solved this in our fork by attaching the renewal info to the last transaction/receipts.
|
eedde53
to
2df4853
Compare
Updated. |
2db33eb
to
e8b2d07
Compare
e8b2d07
to
8421896
Compare
Hi, will you check it? |
The PR adds classes to work with ios 7 style grand unified receips:
Unified::AppReceipt
andUnified::InAppReceipt
.