Skip to content
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

SSK Doesn't check for cancelled_date on Auto-Renewable Subscription #163

Closed
3 of 9 tasks
JB288 opened this issue Mar 11, 2017 · 1 comment
Closed
3 of 9 tasks

SSK Doesn't check for cancelled_date on Auto-Renewable Subscription #163

JB288 opened this issue Mar 11, 2017 · 1 comment

Comments

@JB288
Copy link

JB288 commented Mar 11, 2017

Platform

  • iOS
  • macOS
  • tvOS

In app purchase type

  • Consumable
  • Non-consumable
  • Auto-Renewable Subscription
  • Non-Renewing Subscription

Environment

  • Sandbox
  • Production

Version

0.8.3

Related issues

maybe #106

Report

Issue summary

SwiftyStoreKit seems to ignore/not check for cancellation_date on auto-renewable subscription

What did you expect to happen

To find somewhere in InAppReceipt.swift that it would check for cancellation_date

What happened instead

Didn't find where it checked for cancellation date

Suggestion

Apple's docs say: Treat a canceled receipt the same as if no purchase had ever been made.
In InAppReceipt.filterReceiptsInfo, under

let product_id = receipt["product_id"] as? String

add something like

if (receipt["cancellation_date"] as? String) != nil{
    return false
}
else{
    return product_id == productId
}

Reasoning: It will filter out the cancelled products from the ReceiptInfo array before verifySubscription starts checking for expiration dates, thereby behaving as if a cancelled product was never purchased. However, I have no way of testing because it appears there is no method of cancelling subscriptions in the sandbox.

@JB288
Copy link
Author

JB288 commented Mar 13, 2017

Thanks!

@JB288 JB288 closed this as completed Mar 13, 2017
bizz84 added a commit that referenced this issue Mar 13, 2017
…-cancellation_date

Filter out all receipts with "cancellation_date" != nil (#163)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant