ProductDataManager

public protocol ProductDataManager: DataManager

Product data manager protocol.

  • product(productId:completion:) Default implementation

    Gets the full product for the given product id.

    • Parameters:
      • productId: The product id to use.
      • completion: The completion block that is called upon receiving the response with either a product object or and error.

    Default Implementation

    Declaration

    Swift

    func product(productId: String, completion: @escaping (_ product: ProductType?, _ error: Swift.Error?) -> Void)

    Parameters

    productId

    The product id to use.

    completion

    The completion block that is called upon receiving the response with either a product object or and error.

  • Type of the SKU.

    Declaration

    Swift

    associatedtype SkuType: Sku
  • Type of the product.

    Declaration

    Swift

    associatedtype ProductType: Product
  • sku(forSKUId:productId:completion:) Default implementation

    Gets the SKU matching the given SKU id and product id.

    • Parameters:
      • skuId: The SKU id to use.
      • productId: The product id to use.
      • completion: The completion block.

    Default Implementation

    Declaration

    Swift

    func sku(forSKUId skuId: String,

    Parameters

    skuId

    The SKU id to use.

    productId

    The product id to use.

    completion

    The completion block.