-
Notifications
You must be signed in to change notification settings - Fork 294
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
PurchaseTester
: improved ReceiptInspector
so it accepts receipts with escape sequences
#3554
Conversation
// in kibana, receipts get encoded with extra `\`s | ||
let receiptWithoutForwardSlashes = encodedReceipt.replacingOccurrences(of: "\\", with: "") | ||
// just in case you accidentally copied with extra double-quotations | ||
let receiptWithoutQuotations = receiptWithoutForwardSlashes.replacingOccurrences(of: "\"", with: "") |
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.
FFTI, should we only remove start/end characters instead of all occurences? I think this should also work though, but in order to minify possible changes.
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 thought about it, but I don't think we stand to gain much?
Like, the receipt won't work locally unless it's a valid receipt (save for the double-quotes), and it won't validate against /verifyReceipt
unless the contents are unaltered, so it's pretty safe to just assume you can remove them all in the easiest way possible
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.
Yeah... I guess if it ever could be a valid character it would be a problem, but I don't see that happening. It's fine as it is 👍
4a0dd7c
to
7116f15
Compare
Rebased. |
PurchaseTester
: improved ReceiptInspector
so it accepts receipts with escape sequences
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3554 +/- ##
==========================================
+ Coverage 85.98% 86.03% +0.04%
==========================================
Files 242 242
Lines 17617 17617
==========================================
+ Hits 15148 15156 +8
+ Misses 2469 2461 -8 ☔ View full report in Codecov by Sentry. |
**This is an automatic release.** ### New Features * `StoreProduct`: add localized price per period strings (#3546) via Andy Boedo (@aboedo) ### RevenueCatUI * `Paywalls`: new `.onPurchaseCancelled` and `paywallViewControllerDidCancelPurchase:` (#3578) via NachoSoto (@NachoSoto) * `Paywalls`: improve error display (#3577) via NachoSoto (@NachoSoto) ### Dependency Updates * Bump fastlane-plugin-revenuecat_internal from `0ddee10` to `e6ba247` (#3575) via dependabot[bot] (@dependabot[bot]) ### Other Changes * `PurchaseTester`: improved `ReceiptInspector` so it accepts receipts with escape sequences (#3554) via Andy Boedo (@aboedo)
Receipts in logs have extra escape sequences now (forward slashes), so this updates the ReceiptInspector tool to be able to accept them for easier usage.
It also accepts extra
"
so that if you copied slightly incorrectly it still works.