makePurchase method
Future<AdaptyPurchaseResult>
makePurchase({
- required AdaptyPaywallProduct product,
- AdaptyPurchaseParameters? parameters,
To make the purchase, you have to call this method. Read more on the Adapty Documentation
Parameters:
product: an AdaptyPaywallProduct object retrieved from the paywall.parameters: an AdaptyPurchaseParameters object used to pass additional parameters to the purchase.
Returns:
- The AdaptyPurchaseResult object. This model contains info about the purchase result.
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,
},
);
}