1 | <?php |
||
23 | class OmiseApi |
||
24 | { |
||
25 | const VERSION = '1.0.0-beta1'; |
||
26 | const OMISE_ENDPOINT = 'https://api.omise.co/'; |
||
27 | const OMISE_VAULT_ENDPOINT = 'https://vault.omise.co/'; |
||
28 | const OMISE_VERSION = '2015-11-17'; |
||
29 | |||
30 | /** |
||
31 | * @var HttpClientInterface |
||
32 | */ |
||
33 | private $httpClient; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $options; |
||
39 | |||
40 | /** |
||
41 | * @var HydrationInterface |
||
42 | */ |
||
43 | private $hydration; |
||
44 | |||
45 | /** |
||
46 | * @var Api[] |
||
47 | */ |
||
48 | private static $supports = [ |
||
49 | Facade\Account::class => Api\Account::class, |
||
50 | Facade\Balance::class => Api\Balance::class, |
||
51 | Facade\Charge::class => Api\Charge::class, |
||
52 | Facade\Customer::class => Api\Customer::class, |
||
53 | Facade\Dispute::class => Api\Dispute::class, |
||
54 | Facade\Receipt::class => Api\Receipt::class, |
||
55 | Facade\Recipient::class => Api\Recipient::class, |
||
56 | Facade\Refund::class => Api\Refund::class, |
||
57 | Facade\Token::class => Api\Token::class, |
||
58 | Facade\Transaction::class => Api\Transaction::class, |
||
59 | Facade\Transfer::class => Api\Transfer::class, |
||
60 | ]; |
||
61 | |||
62 | /** |
||
63 | * @param HttpClientInterface $httpClient |
||
64 | * @param array $options |
||
65 | * @param HydrationInterface $hydration |
||
66 | */ |
||
67 | 62 | public function __construct(HttpClientInterface $httpClient, array $options, HydrationInterface $hydration = null) |
|
73 | |||
74 | /** |
||
75 | * @param $apiClass |
||
76 | * |
||
77 | * @return Api |
||
78 | */ |
||
79 | 62 | public function create($apiClass) |
|
87 | |||
88 | /** |
||
89 | * Static use setup. |
||
90 | * |
||
91 | * @param HttpClientInterface $httpClient |
||
92 | * @param array $options |
||
93 | */ |
||
94 | 62 | public static function setupFacade(HttpClientInterface $httpClient, array $options) |
|
110 | |||
111 | /** |
||
112 | * @param string $name |
||
113 | * |
||
114 | * @return Api |
||
115 | */ |
||
116 | public function __get($name) |
||
122 | } |
||
123 |