1
|
|
|
<?php
|
2
|
|
|
|
3
|
|
|
namespace Omnipay\Spreedly\Concerns;
|
4
|
|
|
|
5
|
|
|
trait HasSpreedlyConfig
|
6
|
|
|
{
|
7
|
225 |
|
public function getDefaultParameters()
|
8
|
|
|
{
|
9
|
|
|
return array(
|
10
|
225 |
|
'api_key' => '', // (required) Environment key
|
11
|
225 |
|
'api_secret' => '', // (required) Signing Secret
|
12
|
225 |
|
'default_gateway' => '', // (required) Default gateway
|
|
|
|
|
13
|
225 |
|
'gateways_tokens' => array(), // (required) Default gateway
|
|
|
|
|
14
|
225 |
|
'timeout' => 64, // (optional) Default 64 seconds (recommended by Spreedly)
|
15
|
225 |
|
'connect_timeout' => 10, // (optional) Default 10 seconds
|
|
|
|
|
16
|
225 |
|
'testMode' => false,
|
17
|
225 |
|
);
|
18
|
|
|
}
|
19
|
|
|
|
20
|
78 |
|
public function getApiKey()
|
21
|
|
|
{
|
22
|
78 |
|
return $this->getParameter('api_key');
|
|
|
|
|
23
|
|
|
}
|
24
|
|
|
|
25
|
225 |
|
public function setApiKey($value)
|
26
|
|
|
{
|
27
|
225 |
|
return $this->setParameter('api_key', $value);
|
|
|
|
|
28
|
|
|
}
|
29
|
|
|
|
30
|
78 |
|
public function getApiSecret()
|
31
|
|
|
{
|
32
|
78 |
|
return $this->getParameter('api_secret');
|
|
|
|
|
33
|
|
|
}
|
34
|
|
|
|
35
|
225 |
|
public function setApiSecret($value)
|
36
|
|
|
{
|
37
|
225 |
|
return $this->setParameter('api_secret', $value);
|
|
|
|
|
38
|
|
|
}
|
39
|
|
|
|
40
|
45 |
|
public function getDefaultGateway()
|
41
|
|
|
{
|
42
|
45 |
|
return $this->getParameter('default_gateway');
|
|
|
|
|
43
|
|
|
}
|
44
|
|
|
|
45
|
225 |
|
public function setDefaultGateway($value)
|
46
|
|
|
{
|
47
|
225 |
|
return $this->setParameter('default_gateway', $value);
|
|
|
|
|
48
|
|
|
}
|
49
|
|
|
|
50
|
45 |
|
public function getGatewaysTokens()
|
51
|
|
|
{
|
52
|
45 |
|
return $this->getParameter('gateways_tokens');
|
|
|
|
|
53
|
|
|
}
|
54
|
|
|
|
55
|
225 |
|
public function setGatewaysTokens($value)
|
56
|
|
|
{
|
57
|
225 |
|
return $this->setParameter('gateways_tokens', $value);
|
|
|
|
|
58
|
|
|
}
|
59
|
|
|
|
60
|
27 |
|
public function getTimeout()
|
61
|
|
|
{
|
62
|
27 |
|
return $this->getParameter('timeout');
|
|
|
|
|
63
|
|
|
}
|
64
|
|
|
|
65
|
159 |
|
public function setTimeout($value)
|
66
|
|
|
{
|
67
|
159 |
|
return $this->setParameter('timeout', $value);
|
|
|
|
|
68
|
|
|
}
|
69
|
|
|
|
70
|
27 |
|
public function getConnectTimeout()
|
71
|
|
|
{
|
72
|
27 |
|
return $this->getParameter('connect_timeout');
|
|
|
|
|
73
|
|
|
}
|
74
|
|
|
|
75
|
159 |
|
public function setConnectTimeout($value)
|
76
|
|
|
{
|
77
|
159 |
|
return $this->setParameter('connect_timeout', $value);
|
|
|
|
|
78
|
|
|
}
|
79
|
|
|
}
|
80
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.