purchaseDiscountedPackage static method
Future<PurchaserInfo>
purchaseDiscountedPackage(
- Package packageToPurchase,
- PaymentDiscount discount
iOS only. Purchase a package 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.
packageToPurchase
The Package you wish to purchase
paymentDiscount
Discount to apply to the product. Retrieve this discount
using getPaymentDiscount.
Implementation
static Future<rc.PurchaserInfo> purchaseDiscountedPackage(
rc.Package packageToPurchase, rc.PaymentDiscount discount) async {
return rc.Purchases.purchaseDiscountedPackage(packageToPurchase, discount);
}