react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Transaction Identifiers do not match in Sandbox for iOS

Open gfaraj opened this issue 1 year ago • 3 comments

Describe the bug For iOS Sandbox transactions, the "transaction_id" field in the webhook is something like "StoreKitTest_Transaction_7d5df4466d669078a079d2c0d58f65d9_3" while in-app the result of purchaseProduct will have transactionIdentifier equal to just "3". I'm expecting these two things to match up for some fulfillment logic.

  1. Environment
    1. Platform: iOS
    2. SDK version: 8.2.1
    3. OS version: iOS 18.0 (also tried in 16.4)
    4. Xcode/Android Studio version:
    5. React Native version: 0.73.6
    6. SDK installation (CocoaPods + version or manual):
    7. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
    1. Call purchaseProduct for a consumable product in iOS simulator
    2. Examine result.transaction.transactionIdentifier
      1. Expected: this value is unique and matches the txn id in the webhook request
      2. Actual: this value is not unique and does not match the txn id in the webhook request
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context N/A

gfaraj avatar Sep 22 '24 14:09 gfaraj

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

RCGitBot avatar Sep 22 '24 14:09 RCGitBot

This is expected behavior. When using StoreKit configuration files, the transaction IDs provided by StoreKit are sequential numbers (1, 2, 3), which reset every time you start a new simulator. On the backend, we need to generate unique IDs, which is why you see a different one in the webhook.

One thing to note is that the suffix in the webhook's transaction ID (_1) matches the StoreTransaction.transactionId returned by the SDK.

When a StoreKit config file is not used, the transactionId would match the one in corresponding webhook event

vegaro avatar Sep 23 '24 10:09 vegaro

I was hoping you could override that identifier in the app-side to have it matched, but that's fine. Not a big deal.

gfaraj avatar Sep 23 '24 16:09 gfaraj