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
Pull Request — master (#82)
by
unknown
03:34
created

FlexCheckoutPaymentRequest   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 14
lcom 1
cbo 2
dl 0
loc 88
rs 10
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCheckoutUrl() 0 4 1
A getRequiredFields() 0 11 1
A getValidOgoneUris() 0 4 1
A setPspId() 0 4 1
A setOrderId() 0 4 1
A setAliasId() 0 4 1
A setPm() 0 7 2
A setAccepturl() 0 5 1
A setExceptionurl() 0 5 1
A setLanguage() 0 4 1
A setShaSign() 0 4 1
A getValidOperations() 0 4 1
1
<?php namespace Ogone\FlexCheckout;
2
3
use Ogone\AbstractPaymentRequest;
4
use Ogone\ShaComposer\ShaComposer;
5
6
class FlexCheckoutPaymentRequest extends AbstractPaymentRequest
7
{
8
	const TEST = "https://ogone.test.v-psp.com/Tokenization/HostedPage";
9
	const PRODUCTION = "https://secure.ogone.com/Tokenization/HostedPage";
10
11
	protected $payment_methods = [
12
		"CreditCard",
13
		"DirectDebit",
14
	];
15
16
	public function __construct(ShaComposer $shaComposer)
17
	{
18
		$this->shaComposer = $shaComposer;
19
		$this->ogoneUri    = self::TEST;
20
	}
21
22
	public function getCheckoutUrl()
23
	{
24
		return $this->getOgoneUri()."?". http_build_query($this->toArray());
25
	}
26
27
	public function getRequiredFields()
28
	{
29
		return array(
30
			'account.pspid',
31
			'alias.aliasid',
32
			'alias.orderid',
33
			'card.paymentmethod',
34
			'parameters.accepturl',
35
			'parameters.exceptionurl',
36
		);
37
	}
38
39
	public function getValidOgoneUris()
40
	{
41
		return array(self::TEST, self::PRODUCTION);
42
	}
43
44
	public function setPspId($pspid)
45
	{
46
		$this->parameters['account.pspid'] = $pspid;
47
	}
48
49
	public function setOrderId($orderid)
50
	{
51
		$this->parameters['alias.orderid'] = $orderid;
52
	}
53
54
	public function setAliasId(Alias $alias)
55
	{
56
		$this->parameters['alias.aliasid'] = $alias->getAlias();
57
	}
58
59
	public function setPm($payment_method)
60
	{
61
		if (!in_array($payment_method, $this->payment_methods)) {
62
			throw new \InvalidArgumentException("Unknown Payment method [$payment_method].");
63
		}
64
		$this->parameters['card.paymentmethod'] = $payment_method;
65
	}
66
67
	public function setAccepturl($accepturl)
68
	{
69
		$this->validateUri($accepturl);
70
		$this->parameters['parameters.accepturl'] = $accepturl;
71
	}
72
73
	public function setExceptionurl($exceptionurl)
74
	{
75
		$this->validateUri($exceptionurl);
76
		$this->parameters['parameters.exceptionurl'] = $exceptionurl;
77
	}
78
79
	public function setLanguage($language)
80
	{
81
		$this->parameters['layout.language'] = $language;
82
	}
83
84
	public function setShaSign()
85
	{
86
		$this->parameters['shasignature.shasign'] = parent::getShaSign();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (getShaSign() instead of setShaSign()). Are you sure this is correct? If so, you might want to change this to $this->getShaSign().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
87
	}
88
89
	protected function getValidOperations()
90
	{
91
		return [];
92
	}
93
}
94