VoidRequest::getHttpMethod()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Omnipay\PaypalRest\Message;
4
5
/**
6
 * @author    Ivan Kerin <[email protected]>
7
 * @copyright 2014, Clippings Ltd.
8
 * @license   http://spdx.org/licenses/BSD-3-Clause
9
 */
10
class VoidRequest extends AbstractPaypalRequest
11
{
12
    /**
13
     * @return string
14
     */
15
    public function getEndpoint()
16
    {
17
        $this->validate('transactionReference');
18
19
        return '/payments/authorization/'.$this->getTransactionReference().'/void';
20
    }
21
22
    public function getHttpMethod()
23
    {
24
        return 'POST';
25
    }
26
27
    /**
28
     * @param  mixed        $data
29
     * @return VoidResponse
30
     */
31
    public function sendData($data)
32
    {
33
        $httpResponse = $this->sendHttpRequest($data);
34
35
        return $this->response = new VoidResponse(
36
            $this,
37
            $httpResponse->json(),
38
            $httpResponse->getStatusCode()
39
        );
40
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getData()
46
    {
47
        return array();
48
    }
49
}
50