1 | <?php |
||
10 | class Api |
||
11 | { |
||
12 | const NOTIFY_TOKEN_FIELD = 'echo_4'; |
||
13 | |||
14 | // 1 CREDITCARD 信用卡 |
||
15 | const CREDITCARD = 'CREDITCARD'; |
||
16 | // 2 RECHARGE 儲值卡 |
||
17 | const RECHARGE = 'RECHARGE'; |
||
18 | // 3 CSTORECODE 超商代碼 |
||
19 | const CSTORECODE = 'CSTORECODE'; |
||
20 | // 4 WEBATM WEBATM |
||
21 | const WEBATM = 'WEBATM'; |
||
22 | // 5 TELECOM 電信小額 |
||
23 | const TELECOM = 'TELECOM'; |
||
24 | // 6 E_COLLECTION 虛擬帳號 |
||
25 | const E_COLLECTION = 'E_COLLECTION'; |
||
26 | // 7 UNIONPAY 銀聯卡 |
||
27 | const UNIONPAY = 'UNIONPAY'; |
||
28 | // 8 SVC 點數卡 |
||
29 | const SVC = 'SVC'; |
||
30 | // 9 ABROAD 海外信用卡 |
||
31 | const ABROAD = 'ABROAD'; |
||
32 | // 10 ALIPAY 支付寶 |
||
33 | const ALIPAY = 'ALIPAY'; |
||
34 | // 11 SMARTPAY Smart Pay |
||
35 | const SMARTPAY = 'SMARTPAY'; |
||
36 | |||
37 | /** |
||
38 | * @var \Payum\Core\HttpClientInterface |
||
39 | */ |
||
40 | protected $client; |
||
41 | |||
42 | /** |
||
43 | * @var \Http\Message\MessageFactory |
||
44 | */ |
||
45 | protected $messageFactory; |
||
46 | |||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $options = []; |
||
51 | |||
52 | /** |
||
53 | * $encrypter. |
||
54 | * |
||
55 | * @var Encrypter |
||
56 | */ |
||
57 | protected $encrypter; |
||
58 | |||
59 | /** |
||
60 | * @param array $options |
||
61 | * @param \Payum\Core\HttpClientInterface $client |
||
62 | * @param \Http\Message\MessageFactory $messageFactory |
||
63 | * @param Encrypter $encrypter |
||
64 | * |
||
65 | * @throws \Payum\Core\Exception\InvalidArgumentException if an option is invalid |
||
66 | */ |
||
67 | 5 | public function __construct(array $options, HttpClientInterface $client, MessageFactory $messageFactory, Encrypter $encrypter = null) |
|
74 | |||
75 | /** |
||
76 | * @param array $fields |
||
77 | * @return array |
||
78 | */ |
||
79 | 2 | protected function doRequest(array $fields) |
|
100 | |||
101 | /** |
||
102 | * getApiEndpoint. |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | 3 | public function getApiEndpoint() |
|
110 | |||
111 | /** |
||
112 | * createTransaction. |
||
113 | * |
||
114 | * @param array $params |
||
115 | * @return array |
||
116 | */ |
||
117 | 1 | public function createTransaction(array $params) |
|
216 | |||
217 | /** |
||
218 | * getTransactionData. |
||
219 | * |
||
220 | * @param mixed $params |
||
221 | * @return array |
||
222 | */ |
||
223 | 1 | public function getTransactionData(array $params) |
|
239 | |||
240 | /** |
||
241 | * verifyHash. |
||
242 | * |
||
243 | * @param array $params |
||
244 | * @param array $details |
||
245 | * @return bool |
||
246 | */ |
||
247 | 1 | public function verifyHash(array $params, $details) |
|
251 | } |
||
252 |