purchase method

Future<PurchaseResult> purchase(
  1. StoreProduct product, {
  2. String? promotionalOfferId,
  3. SubscriptionOption? option,
})

Purchases product (optionally via a specific Android option), unpacking productId/productType/basePlanId/offerId for the platform-interface call — callers work with the public StoreProduct / SubscriptionOption models, never raw ids, matching the Swift/Kotlin façades' ergonomics rather than the wire shape.

Implementation

Future<PurchaseResult> purchase(
  StoreProduct product, {
  String? promotionalOfferId,
  SubscriptionOption? option,
}) =>
    _platform.purchase(
      product.id,
      product.type,
      promotionalOfferId: promotionalOfferId,
      basePlanId: option?.basePlanId,
      offerId: option?.offerId,
    );