1 | <?php |
||
19 | class GuzzleHttpClient |
||
20 | { |
||
21 | /** |
||
22 | * @var \GuzzleHttp\Client |
||
23 | */ |
||
24 | private $client; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $checkContentType = true; |
||
30 | |||
31 | /** |
||
32 | * HttpClient constructor. |
||
33 | * @param Client|null $client |
||
34 | */ |
||
35 | 6 | public function __construct(Client $client = null) |
|
39 | |||
40 | /** |
||
41 | * @param bool $setting |
||
42 | * @return void |
||
43 | */ |
||
44 | public function setCheckContentType(bool $setting) |
||
48 | |||
49 | /** |
||
50 | * @param string $url |
||
51 | * @param string $acceptType |
||
52 | * @return ResponseInterface |
||
53 | */ |
||
54 | 6 | private function get($url, string $acceptType) |
|
68 | |||
69 | /** |
||
70 | * @param string $url |
||
71 | * @param string $acceptType |
||
72 | * @param string $dataMIMEType |
||
73 | * @param string $data |
||
74 | * @return ResponseInterface |
||
75 | */ |
||
76 | private function post(string $url, string $acceptType, string $dataMIMEType, string $data): ResponseInterface |
||
94 | |||
95 | /** |
||
96 | * @param string $expectType |
||
97 | * @param ResponseInterface $response |
||
98 | */ |
||
99 | 6 | public function checkContentType(string $expectType, ResponseInterface $response) |
|
110 | |||
111 | /** |
||
112 | * @param string $requestUrl |
||
113 | * @param RequestValidation $requestValidation |
||
114 | * @param NetworkConfigInterface $networkConfig |
||
115 | * @return PaymentRequestInfo |
||
116 | * @throws ProtocolException |
||
117 | * @throws \Bip70\Exception\X509Exception |
||
118 | */ |
||
119 | 6 | public function getRequest(string $requestUrl, RequestValidation $requestValidation, NetworkConfigInterface $networkConfig): PaymentRequestInfo |
|
138 | |||
139 | /** |
||
140 | * @param PaymentDetails $details |
||
141 | * @param NetworkConfigInterface $networkConfig |
||
142 | * @param string|null $memo |
||
143 | * @param string ...$transactions |
||
144 | * @return PaymentACK |
||
145 | */ |
||
146 | public function sendPayment(PaymentDetails $details, NetworkConfigInterface $networkConfig, string $memo = null, string ...$transactions): PaymentACK |
||
178 | } |
||
179 |