blob: 44713fd872bebf215b9ca05af71aa77c11ab00fb (
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
56
57
58
59
60
61
62
63
64
|
package com.mapswithme.maps.purchase;
import android.app.Activity;
import androidx.annotation.NonNull;
import java.util.List;
/**
* Manages a billing flow for the specific product.
*/
public interface BillingManager<T>
{
/**
* Initializes the current billing manager.
*/
void initialize(@NonNull Activity context);
/**
* Destroys the billing manager.
*/
void destroy();
/**
* Launches the billing flow for the product with the specified id.
* Controls whole native part of billing process.
*
* @param productId identifier of the product which is going to be purchased.
*/
void launchBillingFlowForProduct(@NonNull String productId);
/**
* Indicates whether billing is supported for this device or not.
*/
boolean isBillingSupported();
/**
* Queries existing purchases.
*/
void queryExistingPurchases();
/**
* Queries product details for specified products. They will be delivered to the caller
* through callback {@link T}.
*/
void queryProductDetails(@NonNull List<String> productIds);
/**
* Consumes the purchase with the specified token. Result of consumption will be delivered
* through callback {@link T}.
*
* @param purchaseToken purchase token that is going to be consumed.
*/
void consumePurchase(@NonNull String purchaseToken);
/**
* Adds a billing callback.
*/
void addCallback(@NonNull T callback);
/**
* Removes the billing callback.
*/
void removeCallback(@NonNull T callback);
}
|