GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RefundPayment::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace zaporylie\Vipps\Resource\Payment;
4
5
use zaporylie\Vipps\Model\Payment\RequestRefundPayment;
6
use zaporylie\Vipps\Model\Payment\ResponseRefundPayment;
7
use zaporylie\Vipps\Resource\HttpMethod;
8
use zaporylie\Vipps\VippsInterface;
9
10
/**
11
 * Class RefundPayment
12
 *
13
 * @package Vipps\Resource\Payment
14
 */
15
class RefundPayment extends PaymentResourceBase
16
{
17
18
    /**
19
     * @var \zaporylie\Vipps\Resource\HttpMethod
20
     */
21
    protected $method = HttpMethod::POST;
22
23
    /**
24
     * @var string
25
     */
26
    protected $path = '/ecomm/v2/payments/{id}/refund';
27
28
    /**
29
     * InitiatePayment constructor.
30
     *
31
     * @param \zaporylie\Vipps\VippsInterface $vipps
32
     * @param string $subscription_key
33
     * @param string $order_id
34
     * @param \zaporylie\Vipps\Model\Payment\RequestRefundPayment $requestObject
35
     */
36
    public function __construct(
37
        VippsInterface $vipps,
38
        $subscription_key,
39
        $order_id,
40
        RequestRefundPayment $requestObject
41
    ) {
42
        parent::__construct($vipps, $subscription_key);
43
        $this->body = $this
44
            ->getSerializer()
45
            ->serialize(
46
                $requestObject,
47
                'json'
48
            );
49
        $this->id = $order_id;
50
    }
51
52
    /**
53
     * @return \zaporylie\Vipps\Model\Payment\ResponseRefundPayment
54
     */
55
    public function call()
56
    {
57
        $response = $this->makeCall();
58
        $body = $response->getBody()->getContents();
59
        /** @var \zaporylie\Vipps\Model\Payment\ResponseRefundPayment $responseObject */
60
        $responseObject = $this
61
            ->getSerializer()
62
            ->deserialize(
63
                $body,
64
                ResponseRefundPayment::class,
65
                'json'
66
            );
67
68
        return $responseObject;
69
    }
70
}
71