passepartoutvpn / passepartout-app

VPN client for Apple platforms.
https://passepartoutvpn.app
GNU General Public License v3.0
768 stars 119 forks source link

Rewrite wrong refund logic #462

Closed keeshux closed 5 months ago

keeshux commented 5 months ago

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