Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PurchaseController.java « purchase « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d54ebf10f84619afb4401bd04b533bbea531dae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.mapswithme.maps.purchase;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;

import com.mapswithme.maps.base.Savable;

/**
 * Provides necessary purchase functionality to the UI. Controls whole platform-specific billing
 * process. This controller has to be used only within {@link #initialize(Activity)} and {@link #destroy()}
 * interval.
 */
public interface PurchaseController<T> extends Savable<Bundle>
{
  /**
   * Initializes the controller.
   * @param activity the activity which controller serves.
   */
  void initialize(@NonNull Activity activity);

  /**
   * Destroys the controller.
   */
  void destroy();

  /**
   * Indicates whether the purchase flow is supported by this device or not.
   */
  boolean isPurchaseSupported();

  /**
   * Launches the purchase flow for the specified product. The purchase results will be delivered
   * through {@link T} callback.
   *
   * @param productId id of the product which is going to be purchased.
   */
  void launchPurchaseFlow(@NonNull String productId);

  /**
   * Queries product details. They will be delivered to the caller through callback {@link T}.
   */
  void queryProductDetails();

  /**
   * Validates existing purchase. A validation result will be delivered through callback {@link T}.
   */
  void validateExistingPurchases();

  void addCallback(@NonNull T  callback);

  void removeCallback();
}