Skip to content

PurchaseTester: Add Receipt Inspector UI#2249

Merged
aboedo merged 5 commits into
mainfrom
add-receiptparser-to-purchasetester
Feb 3, 2023
Merged

PurchaseTester: Add Receipt Inspector UI#2249
aboedo merged 5 commits into
mainfrom
add-receiptparser-to-purchasetester

Conversation

@aboedo

@aboedo aboedo commented Jan 26, 2023

Copy link
Copy Markdown
Member

Adds a new MenuBar UI to the PurchaseTester app on macOS.

The UI provides a quick utility to parse the local receipt and to check it against /verifyReceipt. This makes it super easy to debug receipts using PurchaseTester.

image

@aboedo aboedo added the test label Jan 26, 2023
@aboedo aboedo self-assigned this Jan 26, 2023
Comment on lines +55 to +70
#if os(macOS)
MenuBarExtra("ReceiptParser", systemImage: "doc.text.magnifyingglass") {
VStack {
ReceiptInspectorView()

Divider()

Button("Quit") {
NSApplication.shared.terminate(nil)
}
.keyboardShortcut("q")
.padding()
}
}
.menuBarExtraStyle(.window)
.defaultSize(width: 800, height: 1000)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the menubar UI, you can use it even without configuring the SDK

.font(.title)
.padding()

TextField("Enter receipt text here (base64 encoded)", text: $encodedReceipt, onEditingChanged: { isEditing in

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main UI, with text field for receipt text, shared secret and the text fields for the receipt

@aboedo aboedo requested a review from a team January 26, 2023 21:07
@aboedo aboedo marked this pull request as ready for review January 26, 2023 21:07
@codecov

codecov Bot commented Jan 26, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2249 (b393ea4) into main (c765b18) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2249      +/-   ##
==========================================
- Coverage   85.90%   85.88%   -0.02%     
==========================================
  Files         183      183              
  Lines       12125    12125              
==========================================
- Hits        10416    10414       -2     
- Misses       1709     1711       +2     
Impacted Files Coverage Δ
...chasing/StoreKitAbstractions/SK1StoreProduct.swift 92.30% <0.00%> (-5.77%) ⬇️
Sources/Networking/HTTPClient/HTTPClient.swift 93.88% <0.00%> (-1.08%) ⬇️
Sources/Logging/Strings/StoreKitStrings.swift 91.17% <0.00%> (+1.47%) ⬆️
Sources/Support/ManageSubscriptionsHelper.swift 70.10% <0.00%> (+2.06%) ⬆️
...s/Logging/Strings/ManageSubscriptionsStrings.swift 81.25% <0.00%> (+6.25%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@NachoSoto NachoSoto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment thread Tests/TestingApps/PurchaseTesterSwiftUI/PurchaseTester.xcodeproj/project.pbxproj Outdated
Comment thread Tests/TestingApps/PurchaseTesterSwiftUI/Shared/ReceiptVerifier.swift Outdated
Comment thread Tests/TestingApps/PurchaseTesterSwiftUI/Shared/ReceiptInspector.swift Outdated
Comment thread Tests/TestingApps/PurchaseTesterSwiftUI/Shared/ReceiptVerifier.swift Outdated
@aboedo aboedo changed the title PurchaseTester: Add Receipt Inspector UI [CSDK-612] PurchaseTester: Add Receipt Inspector UI Jan 27, 2023
@aboedo aboedo requested a review from NachoSoto January 27, 2023 15:35
@NachoSoto

Copy link
Copy Markdown
Contributor

I mentioned this a while ago, I wonder what others think:
I think putting the Jira numbers in the commit message is unnecessary noise for an open source repo. Anyone outside of RC doesn't have access to that data, so seeing that in the commit history isn't helpful. I'd vote for only putting that in the commit description (where Jira also automatically creates a link, which is nice).

@aboedo

aboedo commented Jan 27, 2023

Copy link
Copy Markdown
Member Author

sure! I don't really have a strong preference there. We do squash so after the PR is merged the commit message disappears, though, right? I added it this time to try out how the integration works, since I forgot to add it to the PR Title initially

@NachoSoto

Copy link
Copy Markdown
Contributor

Right, I meant the PR title cause that'll become the commit message right?

@aboedo

aboedo commented Jan 27, 2023

Copy link
Copy Markdown
Member Author

ohh 🤦 right, that makes sense. I'll remove it

@aboedo aboedo changed the title [CSDK-612] PurchaseTester: Add Receipt Inspector UI PurchaseTester: Add Receipt Inspector UI Jan 27, 2023

@NachoSoto NachoSoto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I already approved this, sorry.

@aboedo aboedo merged commit aa8c750 into main Feb 3, 2023
@aboedo aboedo deleted the add-receiptparser-to-purchasetester branch February 3, 2023 13:58
NachoSoto pushed a commit that referenced this pull request Feb 8, 2023
**This is an automatic release.**

### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `738f255` to `9255366`
(#2264) via dependabot[bot] (@dependabot[bot])
* Update `Gemfile.lock` (#2254) via Cesar de la Vega (@vegaro)
### Other Changes
* `HTTPClient`: added support for sending `X-Nonce` (#2214) via
NachoSoto (@NachoSoto)
* `Configuration`: added (`internal` for now) API to load public key
(#2215) via NachoSoto (@NachoSoto)
* Replaced `Any` uses for workaround with `Box` (#2250) via NachoSoto
(@NachoSoto)
* `HTTPClientTests`: fixed failing test with missing assertions (#2262)
via NachoSoto (@NachoSoto)
* `HTTPClientTests`: refactored tests to use `waitUntil` (#2257) via
NachoSoto (@NachoSoto)
* PurchaseTester: Add Receipt Inspector UI (#2249) via Andy Boedo
(@aboedo)
* Adds dependabot (#2259) via Cesar de la Vega (@vegaro)
* `StoreKit1WrapperTests`: avoid using `Bool.random` to fix flaky code
coverage (#2258) via NachoSoto (@NachoSoto)
* `IntroEligibilityCalculator`: changed logic to handle products with no
subscription group (#2247) via NachoSoto (@NachoSoto)
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

Successfully merging this pull request may close these issues.

2 participants