Repository: flutter
Issue: [In-App-Purchase][iOS] Server Verification Data is Same for all failed product in next app session
Labels: platform-ios,p: in_app_purchase,package,P2,team-ios,triaged-ios

### Steps to reproduce

Let's say I have 2 products for coin_30 and coin_100

1. Try purchasing 30 coins, and 100 coins, the store will succeed in making purchase, but do not call complete purchase on mobile (To simulate the case where the server failed to ACK to the mobile client)

2. In the next app session the SDK will trigger `purchaseStream` with the information of 30 and 100 coin

The data SDK provides has, the correct productId but serverVerificationData is same for both products, due to which server cannot confirm the purchase.

PS: This doesn't occur when we are doing in one app session (serverVerificationData will always be unique for each product purchases)

### Expected results

For the failed transaction, when the `purchaseStream` will be triggered in next app session it should provide the unique `serverVerficiationData` like it should. 

### Actual results

For the failed transaction, when the `purchaseStream` is triggered in the next app session it provides me the same `purchaseDetails.verificationData.serverVerificationData`

### Code sample

<details open><summary>Code sample</summary>

```dart
class InAppPurchaseService {
  late StreamSubscription<List<PurchaseDetails>> _subscription;

  void init() {
    final instance = InAppPurchase.instance;

    final Stream<List<PurchaseDetails>> purchaseUpdated =
        instance.purchaseStream;
    _subscription = purchaseUpdated.listen(
      _listenToPurchaseUpdated,
    );

    void _listenToPurchaseUpdated(List<PurchaseDetails> purchaseDetailsList) {
      purchaseDetailsList.forEach((PurchaseDetails purchaseDetails) async {
        if (purchaseDetails.status == PurchaseStatus.error) {
          log("_listenToPurchaseUpdated error");
        } else if (purchaseDetails.status == PurchaseStatus.purchased) {
          _handlePurchaseVerification(purchaseDetails);
        } else if (purchaseDetails.status == PurchaseStatus.canceled) {
          log("_listenToPurchaseUpdated cancel");
          if (Platform.isIOS) {
            await InAppPurchase.instance.completePurchase(purchaseDetails);
          }
        } else if (purchaseDetails.status == PurchaseStatus.restored) {}
      });
    }

    void _handlePurchaseVerification(PurchaseDetails purchaseDetails) async {
      _handleVerifyPurchase(purchaseDetails);
    }

    void _handleVerifyPurchase(purchaseDetails) async {
      try {
        final verifyPurchaseDTO = VerifyPurchaseDTO(
          store: Platform.isIOS ? appleStore : androidStore,
          purchase: PurchaseEntity(
            productId: purchaseDetails.productID,

            /// [purchaseDetails.verificationData.serverVerificationData] is unique when pruchase is successful in session
            /// But it is same for all product when this method will be triggered in next app session for the previous failed transaction (or lets say unconsumed products)
            serverVerificationData:
                purchaseDetails.verificationData.serverVerificationData,
          ),
        );

        /// API Call with purchase details
        await transactionService.verifyCoinPurchase(
          verifyPurchaseDTO,
        );

        /// Mark purchase as completed to close the transaction
        await InAppPurchase.instance.completePurchase(purchaseDetails);
      } catch (e, s) {}
    }
  }
}

void main() async {
  InAppPurchaseService().init();
  runApp(TestApp());
}

```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.19.2, on macOS 14.5 23F79 darwin-arm64, locale en-NP)
    • Flutter version 3.19.2 on channel stable at /Users/pawanacharya/fvm/versions/3.19.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7482962148 (4 months ago), 2024-02-27 16:51:22 -0500
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/pawanacharya/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /Users/pawanacharya/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
```

</details>