1 | <?php |
||
45 | class OmiseApi |
||
46 | { |
||
47 | const VERSION = '1.0.0-beta1'; |
||
48 | const OMISE_ENDPOINT = 'https://api.omise.co/'; |
||
49 | const OMISE_VAULT_ENDPOINT = 'https://vault.omise.co/'; |
||
50 | const OMISE_VERSION = '2015-11-17'; |
||
51 | |||
52 | /** |
||
53 | * @var HttpClientInterface |
||
54 | */ |
||
55 | private $httpClient; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private $options; |
||
61 | |||
62 | /** |
||
63 | * @var HydrationInterface |
||
64 | */ |
||
65 | private $hydration; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | */ |
||
70 | private static $supports = [ |
||
71 | Account::class => AccountApi::class, |
||
72 | Balance::class => BalanceApi::class, |
||
73 | Charge::class => ChargeApi::class, |
||
74 | Customer::class => CustomerApi::class, |
||
75 | Dispute::class => DisputeApi::class, |
||
76 | Receipt::class => ReceiptApi::class, |
||
77 | Recipient::class => RecipientApi::class, |
||
78 | Refund::class => RefundApi::class, |
||
79 | Token::class => TokenApi::class, |
||
80 | Transaction::class => TransactionApi::class, |
||
81 | Transfer::class => TransferApi::class, |
||
82 | ]; |
||
83 | |||
84 | /** |
||
85 | * @param HttpClientInterface $httpClient |
||
86 | * @param array $options |
||
87 | * @param HydrationInterface $hydration |
||
88 | */ |
||
89 | 62 | public function __construct(HttpClientInterface $httpClient, array $options, HydrationInterface $hydration = null) |
|
90 | { |
||
91 | 62 | $this->httpClient = $httpClient; |
|
92 | 62 | $this->options = $options; |
|
93 | 62 | $this->hydration = $hydration; |
|
94 | 62 | } |
|
95 | |||
96 | /** |
||
97 | * @param $apiClass |
||
98 | * |
||
99 | * @return Api |
||
100 | */ |
||
101 | 62 | public function create($apiClass) |
|
109 | |||
110 | /** |
||
111 | * Static use setup. |
||
112 | * |
||
113 | * @param HttpClientInterface $httpClient |
||
114 | * @param array $options |
||
115 | */ |
||
116 | 62 | public static function setupFacade(HttpClientInterface $httpClient, array $options) |
|
132 | } |
||
133 |