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

Rewrite wrong refund logic #462

Merged
merged 5 commits into from
Jan 10, 2024
Merged

Rewrite wrong refund logic #462

merged 5 commits into from
Jan 10, 2024

Conversation

keeshux
Copy link
Member

@keeshux keeshux commented Jan 10, 2024

According to Apple and Kvitto documentation, any receipt with a cancellation date should be discarded.

The app has always had this logic wrong, but it only revealed the issue after adding cancelledPurchases.contains() to the feature eligibility condition:

https://github.com/passepartoutvpn/passepartout-apple/blob/821d4c79f43c1bbad30d4611fba25c409dabebc9/PassepartoutLibrary/Sources/PassepartoutFrontend/Managers/ProductManager.swift#L222

So, if both a purchase and a refund of feature .foobar existed, whatever the dates, the purchase was incorrectly discarded.

Fixes #459, fixes #461

@keeshux keeshux self-assigned this Jan 10, 2024
@keeshux keeshux added the bug Something isn't working label Jan 10, 2024
@keeshux keeshux merged commit 2e989fd into master Jan 10, 2024
1 check failed
@keeshux keeshux deleted the bugfix/refund-logic branch January 10, 2024 17:48
@keeshux keeshux added this to the Test in-app purchases milestone Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Purchase is not credited if any refund was issued in the past "Restore purchases" not working
1 participant