inAppPurchasePayment static method

Future<void> inAppPurchasePayment({
  1. required String userId,
  2. required List<String> productIds,
  3. required double amount,
  4. String paymentType = "In App Purchase",
  5. dynamic onShowToast()?,
  6. dynamic onPaymentSuccess()?,
  7. dynamic onPaymentFailure()?,
})

In-App Purchase Payment

Implementation

static Future<void> inAppPurchasePayment({
  required String userId,
  required List<String> productIds,
  required double amount,
  String paymentType = "In App Purchase",
  Function()? onShowToast,
  Function()? onPaymentSuccess,
  Function()? onPaymentFailure,
}) async {
  final request = PurchaseRequest(
    userId: userId,
    productIds: productIds,
    amount: amount,
    paymentType: paymentType,
  );

  InAppPurchaseHelper().init(request);
  await InAppPurchaseHelper().debugProductLoading();
  InAppPurchaseHelper().initStoreInfo();
}