validatePurchases method

List<PurchaseDetails> validatePurchases(
  1. List<PurchaseDetails> purchaseData
)

Implementation

List<PurchaseDetails> validatePurchases(List<PurchaseDetails> purchaseData) {
  List<PurchaseDetails> validatedPurchases = [];
  for (final purchase in purchaseData) {
    bool isValid = validateSubscription(purchase);
    if (isValid) {
      validatedPurchases.add(purchase);
    }
  }
  return validatedPurchases;
}