ConfirmRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
ccs 0
cts 13
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendData() 0 3 1
A getData() 0 9 1
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
}