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

PaymentQueueWrapper: handle promotional purchase requests from App Store when SK1 is disabled #1901

Merged
merged 7 commits into from
Sep 21, 2022

Commits on Sep 19, 2022

  1. PaymentQueueWrapper: handle promotional purchase requests from App …

    …Store when SK1 is disabled
    
    Follow up to #1882. After that PR, `StoreKit1Wrapper` was no longer listening to `SKPaymentQueueDelegate.paymentQueue(:shouldAddStorePayment:for:)`, which means that purchases initiated from the App Store were being ignored by the SDK if SK2 is enabled.
    
    To fix this, `PaymentQueueWrapper` now becomes the `SKPaymentQueueDelegate` only when `StoreKit1Wrapper` is not initialized, and `PurchasesOrchestrator` initiates an SK2 purchase instead.
    
    - `PurchasesOrchestrator` purchase methods no longer need the whole `PromotionalOffer`, only the `SignedData`. This allows the new implementation to create that data from only the `SKPaymentDiscount` provided from the `SKPayment`.
    
    - [ ] Test that `StoreKit1Wrapper` is the delegate if SK1 is enabled
    - [ ] Test that `PaymentQueueWrapper` is the delegate otherwise
    - [ ] Test `PromotionalOffer.SignedData` initialization from SK1
    - [ ] Test conversion of SK1 product to SK2.
    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    0c376a3 View commit details
    Browse the repository at this point in the history
  2. Added tests

    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    42c4325 View commit details
    Browse the repository at this point in the history
  3. Fixed build

    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    afa91a7 View commit details
    Browse the repository at this point in the history
  4. Documented return false

    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    2a014af View commit details
    Browse the repository at this point in the history
  5. Removed unused method

    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    e4d513e View commit details
    Browse the repository at this point in the history
  6. Fixed release build

    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    804f0ac View commit details
    Browse the repository at this point in the history
  7. Added log

    NachoSoto committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    f21674b View commit details
    Browse the repository at this point in the history