1 | <?php |
||
26 | final class Resource implements InitializationInterface { |
||
27 | /** |
||
28 | * Consumption state constants |
||
29 | */ |
||
30 | const STATE_YET_CONSUMED = 0, |
||
31 | STATE_CONSUMED = 1; |
||
32 | |||
33 | /** |
||
34 | * Order state constants |
||
35 | */ |
||
36 | const ORDER_PURCHASED = 0, |
||
37 | ORDER_CANCELLED = 1, |
||
38 | ORDER_UNKNOWN = -1; |
||
39 | |||
40 | /** |
||
41 | * @var int purchase consumption state |
||
42 | */ |
||
43 | private $consumptionState = 0; |
||
44 | |||
45 | /** |
||
46 | * @var string developer-specified string that contains supplemental information about an order |
||
47 | */ |
||
48 | private $developerPayload = ''; |
||
49 | |||
50 | /** |
||
51 | * @var string represents an in-app purchase object in the android publisher service |
||
52 | */ |
||
53 | private $kind = ''; |
||
54 | |||
55 | /** |
||
56 | * @var int purchase state of the order |
||
57 | */ |
||
58 | private $purchaseState = self::ORDER_UNKNOWN; |
||
59 | |||
60 | /** |
||
61 | * @var int time the product was purchased, milliseconds |
||
62 | */ |
||
63 | private $purchaseTimeMillis = 0; |
||
64 | |||
65 | /** |
||
66 | * @return int purchase consumption state |
||
67 | */ |
||
68 | 2 | public function getConsumptionState() { |
|
71 | |||
72 | /** |
||
73 | * @return bool is purchase consumed |
||
74 | */ |
||
75 | 2 | public function isConsumed() { |
|
78 | |||
79 | /** |
||
80 | * @return string developer-specified string that contains supplemental information about an order |
||
81 | */ |
||
82 | 2 | public function getDeveloperPayload() { |
|
85 | |||
86 | /** |
||
87 | * @return string represents an in-app purchase object in the android publisher service |
||
88 | */ |
||
89 | 2 | public function getKind() { |
|
92 | |||
93 | /** |
||
94 | * @return int purchase state of the order |
||
95 | */ |
||
96 | 2 | public function getPurchaseState() { |
|
99 | |||
100 | /** |
||
101 | * @return bool is product cancelled |
||
102 | */ |
||
103 | 2 | public function isCancelled() { |
|
106 | |||
107 | /** |
||
108 | * @return bool is product purchased |
||
109 | */ |
||
110 | 2 | public function isPurchased() { |
|
113 | |||
114 | /** |
||
115 | * @return int time the product was purchased, milliseconds |
||
116 | */ |
||
117 | 2 | public function getPurchaseTimeMillis() { |
|
120 | |||
121 | /** |
||
122 | * @inheritdoc |
||
123 | */ |
||
124 | 1 | public static function initializeByString($string) { |
|
135 | |||
136 | /** |
||
137 | * @inheritdoc |
||
138 | */ |
||
139 | 1 | public function __toString() { |
|
173 | } |
||
174 |