FetchRequest::sendData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
4
/**
5
 * 交易查询 @docs: 3.3
6
 */
7
namespace Omnipay\MyCard\Message;
8
9
10
class FetchRequest extends AbstractRequest
11
{
12
13
    public function getData()
14
    {
15
        $endpoint = $this->getEndpoint('b2b') . '/MyBillingPay/api/TradeQuery';
16
        $requestData = [
17
            'AuthCode' => $this->getToken()
18
        ];
19
        $response = $this->httpClient->post($endpoint, null, $requestData)->send();
20
        $data = json_decode($response->getBody(), true);
21
        return $data;
22
    }
23
24
25
    public function sendData($data)
26
    {
27
        return new FetchResponse($this, $data);
28
    }
29
30
}