purchaseDiscountedProduct static method
iOS only. Purchase a product applying a given discount.
Returns a PurchaserInfo
object. Throws a
PlatformException if the purchase is unsuccessful.
Check if PurchasesErrorHelper.getErrorCode(e)
is
PurchasesErrorCode.purchaseCancelledError
to check if the user cancelled
the purchase.
product
The product to purchase.
paymentDiscount
Discount to apply to the product. Retrieve this discount
using getPaymentDiscount.
Implementation
static Future<rc.PurchaserInfo> purchaseDiscountedProduct(
rc.Product product, rc.PaymentDiscount discount) async {
return rc.Purchases.purchaseDiscountedProduct(product, discount);
}