chanceGuiltBrassElapseTicket method

Future<void> chanceGuiltBrassElapseTicket(
  1. List<PurchaseDetails> sprayRegretClearanceNoted
)

Implementation

Future<void> chanceGuiltBrassElapseTicket(
    List<PurchaseDetails> sprayRegretClearanceNoted) async {
  for (int i = 0; i < sprayRegretClearanceNoted.length; i++) {
    if (sprayRegretClearanceNoted[i].status != PurchaseStatus.pending) {
      SmartDialog.dismiss();
      if (sprayRegretClearanceNoted[i].status == PurchaseStatus.error) {
        if (sprayRegretClearanceNoted[i].pendingCompletePurchase) {
          await realityHeroinVisible
              .completePurchase(sprayRegretClearanceNoted[i]);
        }
        await panelEnhanceAnalystQualify();
        showErrorMessage(
            'Error: ${sprayRegretClearanceNoted[i].error!.message}');
      } else if ((PurchaseStatus.restored ==
              sprayRegretClearanceNoted[i].status) ||
          (PurchaseStatus.purchased == sprayRegretClearanceNoted[i].status)) {
        if (await syndromeDeclarationSmoke(sprayRegretClearanceNoted[i])) {
          if (sprayRegretClearanceNoted[i].pendingCompletePurchase) {
            await realityHeroinVisible
                .completePurchase(sprayRegretClearanceNoted[i]);
          }
          if (!CoastThrowConvertSafety().tireSteppedFlawed) {
            await seasonLunchRemarkApproval();
          }
          FacebookAppEvents facebookAppEvents = FacebookAppEvents();
          final rawPriceItem = CoastThrowConvertSafety()
              .goldenBrainConstruct
              .firstWhere((item) =>
                  item.battleUniverseNoticeKey ==
                  sprayRegretClearanceNoted[i].productID);
          await facebookAppEvents.logPurchase(
            amount: rawPriceItem.screamFlawedVoyageCircle,
            currency: 'USD',
            parameters: {
              'fb_mobile_purchase': 'true',
            },
          );
          await panelEnhanceAnalystQualify();
        }
      } else if (PurchaseStatus.canceled ==
          sprayRegretClearanceNoted[i].status) {
        if (sprayRegretClearanceNoted[i].pendingCompletePurchase) {
          await realityHeroinVisible
              .completePurchase(sprayRegretClearanceNoted[i]);
        }
        await panelEnhanceAnalystQualify();
        showErrorMessage('The payment was not approved.');
      }
    } else {
      SmartDialog.showLoading(msg: 'Loading...');
      if (sprayRegretClearanceNoted[i].pendingCompletePurchase) {
        InAppPurchase.instance.completePurchase(sprayRegretClearanceNoted[i]);
      }
    }
  }
}