makePurchase method

Future<AdaptyPurchaseResult> makePurchase({
  1. required AdaptyPaywallProduct product,
  2. AdaptyPurchaseParameters? parameters,
})

To make the purchase, you have to call this method. Read more on the Adapty Documentation

Parameters:

Returns:

Implementation

Future<AdaptyPurchaseResult> makePurchase({
  required AdaptyPaywallProduct product,
  AdaptyPurchaseParameters? parameters,
}) {
  return _invokeMethod<AdaptyPurchaseResult>(
    Method.makePurchase,
    (data) {
      final purchaseResultMap = data as Map<String, dynamic>;
      return AdaptyPurchaseResultJSONBuilder.fromJsonValue(purchaseResultMap);
    },
    {
      Argument.product: product.jsonValue,
      if (parameters != null) Argument.parameters: parameters.jsonValue,
    },
  );
}