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

AppleReceipt: refactored declarations into nested types #1933

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

NachoSoto
Copy link
Contributor

Before this change we had a lot of global types. Now they're all nested inside of AppleReceipt, InAppPurchase, and InAppPurchaseBuilder.

Before this change we had a lot of global types. Now they're all nested inside of `AppleReceipt`, `InAppPurchase`, and `InAppPurchaseBuilder`.
@NachoSoto NachoSoto requested review from aboedo and a team September 22, 2022 23:15
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Nice cleanup!

@NachoSoto NachoSoto merged commit adf6353 into main Sep 23, 2022
@NachoSoto NachoSoto deleted the apple-receipt-types-refactor branch September 23, 2022 17:38
NachoSoto added a commit that referenced this pull request Sep 27, 2022
**This is an automatic release.**

### New Features
* 🚨 `StoreKit 2` is now enabled by default 🚨 (#1922) via NachoSoto
(@NachoSoto)
* Extracted `PurchasesType` and `PurchasesSwiftType` (#1912) via
NachoSoto (@NachoSoto)
### Bugfixes
* `StoreKit 1`: changed result of cancelled purchases to be consistent
with `StoreKit 2` (#1910) via NachoSoto (@NachoSoto)
* `PaymentQueueWrapper`: handle promotional purchase requests from App
Store when SK1 is disabled (#1901) via NachoSoto (@NachoSoto)
### Other Changes
* Fixed iOS 12 tests (#1936) via NachoSoto (@NachoSoto)
* `CacheableNetworkOperation`: fixed race condition in new test (#1932)
via NachoSoto (@NachoSoto)
* `BasePurchasesTests`: changed default back to SK1 (#1935) via
NachoSoto (@NachoSoto)
* `Logger`: refactored default `LogLevel` definition (#1934) via
NachoSoto (@NachoSoto)
* `AppleReceipt`: refactored declarations into nested types (#1933) via
NachoSoto (@NachoSoto)
* `Integration Tests`: relaunch tests when retrying failures (#1925) via
NachoSoto (@NachoSoto)
* `CircleCI`: downgraded release jobs to Xcode 13.x (#1927) via
NachoSoto (@NachoSoto)
* `ErrorUtils`: added test to verify that `PublicError`s can be
`catch`'d as `ErrorCode` (#1924) via NachoSoto (@NachoSoto)
* `StoreKitIntegrationTests`: print `AppleReceipt` data whenever
`verifyEntitlementWentThrough` fails (#1929) via NachoSoto (@NachoSoto)
* `OperationQueue`: log debug message when requests are found in cache
and skipped (#1926) via NachoSoto (@NachoSoto)
* `GetCustomerInfoAPI`: avoid making a request if there's any
`PostReceiptDataOperation` in progress (#1911) via NachoSoto
(@NachoSoto)
* `PurchaseTester`: allow HTTP requests and enable setting `ProxyURL`
(#1917) via NachoSoto (@NachoSoto)
NachoSoto added a commit that referenced this pull request Sep 27, 2022
The name `InAppPurchase` is too general. This type in particular is specific to the content of `AppleReceipt`, so nesting it makes that clear.
Follow up to #1933.
NachoSoto added a commit that referenced this pull request Sep 28, 2022
commit 2221edaeb8ee259748f231beb024565196c8b173
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 18:14:31 2022 -0700

    Printing invalid receipt

commit 0781bf43a8354c73e6815285c19ecdf25509bfe7
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 18:09:16 2022 -0700

    Don't return invalid receipts

commit ba64e8483934590378b17d1492493d3f99b8525b
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 17:48:13 2022 -0700

    Using `.retryUntilProductIsFound`

commit a38126aae6b7621d775de2bdc71ede06fde3d5d1
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 17:47:56 2022 -0700

    Added `ReceiptRefreshPolicy.retryUntilProductIsFound`

commit abcc2f31e8a8de57895481e1de5f94e8c948eba1
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 13:47:03 2022 -0700

    [move] Abstracted conversion from `async` to completion-block APIs

    Created `Async` with some shared methods that make this conversion simpler in a type-safe way.

commit 22200e53f1753098d8c7e896ac407c4c404d4fc2
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 12:53:38 2022 -0700

    Moved `InAppPurchase` into `AppleReceipt`

    The name `InAppPurchase` is too general. This type in particular is specific to the content of `AppleReceipt`, so nesting it makes that clear.
    Follow up to #1933.

commit 84519ac5214668998293019ba437d51b49a1733c
Author: NachoSoto <ignaciosoto90@gmail.com>
Date:   Tue Sep 27 12:40:54 2022 -0700

    [move] Refactored `ReceiptFetcher.receiptData`

    I'm considering adding a 4th `ReceiptRefreshPolicy` that re-fetches the receipt N-times until it finds a transaction for a recently purchased product ([CSDK-478]).
    This will make it easier to implement.
NachoSoto added a commit that referenced this pull request Sep 28, 2022
The name `InAppPurchase` is too general. This type in particular is
specific to the content of `AppleReceipt`, so nesting it makes that
clear.
Follow up to #1933.
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