ConfirmRequest::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 9
cp 0
crap 2
rs 9.6666
1
<?php
2
3
4
/**
5
 * 交易确认
6
 */
7
namespace Omnipay\MyCard\Message;
8
9
10
class ConfirmRequest extends AbstractRequest
11
{
12
13
    public function getData()
14
    {
15
        $endpoint = $this->getEndpoint('b2b') . '/MyBillingPay/api/PaymentConfirm';
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 ConfirmResponse($this, $data);
28
    }
29
30
}