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