Skip to content

NonSubscriptionTransaction.transactionIdentifier Does not match StoreTransaction.identifier #3636

Description

@dabby-wombo

Describe the bug
I'm trying to add consumable purchases using the guide suggested in the docs. On purchase of the product, in a final check step, I want to check to ensure that RevenueCat has processed the transaction and has added it to the user's CustomerInfo object.

However on purchase of the consumable, the id/tranasctionIdentifier of the returned StoreTransaction from the Purchases.shared.purchase(package:) does not match the NonSubscriptionTransaction of the CustomerInfo.nonSubscriptions. This leaves us with no way of checking that the transactionId is valid or reflected in RevenueCat.

Looking into the NonSubscriptionTransaction, it has an internal storeTransactionIdentifier and this does match the StoreTransaction.id but because it's internal, it can't be used.

Can we make the NonSubscriptionTransaction .storeTransactionIdentifier public? If not, please can you advise on the best approach to achieve this check.

  1. Environment

    1. Platform: iOS
    2. SDK version: 4.35.0
    3. StoreKit version:
      • StoreKit 1
      • StoreKit 2 (enabled with usesStoreKit2IfAvailable(true))
    4. OS version: 14.3
    5. Xcode version: 15.2
    6. Device and/or simulator:
      • Device
      • Simulator
    7. Environment:
      • Sandbox
      • TestFight
      • Production
    8. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.

(lldb) po transaction
<StoreTransaction:
    identifier="2"
    product="dream_dev_creation_premium"
    date="2024-02-06 02:29:12 +0000"
    quantity=1
>

vs

<NonSubscriptionTransaction:
    productIdentifier=dream_dev_creation_premium
    purchaseDate=2024-02-06 02:29:12 +0000
    transactionIdentifier=38f13a6667
    storeTransactionIdentifier=2
>
  1. Steps to reproduce, with a description of expected vs. actual behavior
  • Purchase a consumable product
  • Try to check the returned StoreTransaction.id is contained in the customerInfo.nonSubscription using:
customerInfo.nonSubscriptions.first(
            where: { $0.productIdentifier == transaction.productIdentifier && $0.transactionIdentifier == transaction.transactionIdentifier }
  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
    N/A

  2. Additional context
    Add any other context about the problem here.
    N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions