addPurchaseUnit method

void addPurchaseUnit(
  1. FPayPalPurchaseUnit pUnit
)

adds an item to be purchased @throws Exception if init() was not called before this function

Implementation

void addPurchaseUnit(FPayPalPurchaseUnit pUnit) {
  if (!_initiated) {
    throw Exception(
      "you must initiate package first. call FlutterPaypal.instance.init()",
    );
  }
  purchaseUnits.add(pUnit);
}