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.
Completed
Push — 1.x ( f2247a...73fe3f )
by Jakub
04:00
created

InitiatePayment::call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 15
Ratio 100 %

Importance

Changes 0
Metric Value
dl 15
loc 15
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace zaporylie\Vipps\Resource\Payment;
4
5
use zaporylie\Vipps\Model\Payment\RequestInitiatePayment;
6
use zaporylie\Vipps\Model\Payment\ResponseInitiatePayment;
7
use zaporylie\Vipps\Resource\HttpMethod;
8
use zaporylie\Vipps\VippsInterface;
9
10
/**
11
 * Class InitiatePayment
12
 *
13
 * @package Vipps\Resource\Payment
14
 */
15 View Code Duplication
class InitiatePayment extends PaymentResourceBase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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/v1/payments';
27
28
    /**
29
     * InitiatePayment constructor.
30
     *
31
     * @param \zaporylie\Vipps\VippsInterface $vipps
32
     * @param string $subscription_key
33
     * @param \zaporylie\Vipps\Model\Payment\RequestInitiatePayment $requestObject
34
     */
35
    public function __construct(VippsInterface $vipps, $subscription_key, RequestInitiatePayment $requestObject)
36
    {
37
        parent::__construct($vipps, $subscription_key);
38
        $this->body = $this
39
            ->getSerializer()
40
            ->serialize(
41
                $requestObject,
42
                'json'
43
            );
44
    }
45
46
    /**
47
     * @return \zaporylie\Vipps\Model\Payment\ResponseInitiatePayment
48
     */
49
    public function call()
50
    {
51
        $response = $this->makeCall();
52
        $body = $response->getBody()->getContents();
53
        /** @var \zaporylie\Vipps\Model\Payment\ResponseInitiatePayment $responseObject */
54
        $responseObject = $this
55
            ->getSerializer()
56
            ->deserialize(
57
                $body,
58
                ResponseInitiatePayment::class,
59
                'json'
60
            );
61
62
        return $responseObject;
63
    }
64
}
65