1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright 2015 Alexey Maslov <[email protected]> |
4
|
|
|
* |
5
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
6
|
|
|
* you may not use this file except in compliance with the License. |
7
|
|
|
* You may obtain a copy of the License at |
8
|
|
|
* |
9
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
10
|
|
|
* |
11
|
|
|
* Unless required by applicable law or agreed to in writing, software |
12
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
13
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14
|
|
|
* See the License for the specific language governing permissions and |
15
|
|
|
* limitations under the License. |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
namespace alxmsl\Google\AndroidPublisher\InAppProducts; |
19
|
|
|
|
20
|
|
|
use alxmsl\Google\ObjectInitializedInterface; |
21
|
|
|
use stdClass; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Buyer region price |
25
|
|
|
* @author alxmsl |
26
|
|
|
*/ |
27
|
|
|
final class Price implements ObjectInitializedInterface { |
28
|
|
|
/** |
29
|
|
|
* @var string currency code, as defined by ISO 4217 |
30
|
|
|
*/ |
31
|
|
|
private $currency = ''; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string price in millionths of the currency base unit represented as a string |
35
|
|
|
*/ |
36
|
|
|
private $priceMicros = ''; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return string currency code, as defined by ISO 4217 |
40
|
|
|
*/ |
41
|
2 |
|
public function getCurrency() { |
42
|
2 |
|
return $this->currency; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @return string price in millionths of the currency base unit represented as a string |
47
|
|
|
*/ |
48
|
2 |
|
public function getPriceMicros() { |
49
|
2 |
|
return $this->priceMicros; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @inheritdoc |
54
|
|
|
*/ |
55
|
1 |
|
public static function initializeByObject(stdClass $Object) { |
56
|
1 |
|
$Instance = new self(); |
57
|
1 |
|
$Instance->currency = (string) $Object->currency; |
58
|
1 |
|
$Instance->priceMicros = (string) $Object->priceMicros; |
59
|
1 |
|
return $Instance; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|