1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Loevgaard\DandomainFoundation\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\PaymentMethodInterface; |
|
|
|
|
7
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\PaymentMethodTrait; |
|
|
|
|
8
|
|
|
use Money\Currency; |
|
|
|
|
9
|
|
|
use Money\Money; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* @ORM\Entity() |
13
|
|
|
* @ORM\Table(name="ldf_payment_methods") |
14
|
|
|
* |
15
|
|
|
* @todo a lot of missing properties on this entity, see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/SettingService/help/operations/GetPaymentMethods |
16
|
|
|
*/ |
17
|
|
|
class PaymentMethod extends AbstractEntity implements PaymentMethodInterface |
18
|
|
|
{ |
19
|
|
|
use PaymentMethodTrait; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var int |
23
|
|
|
* |
24
|
|
|
* @ORM\Id |
25
|
|
|
* @ORM\GeneratedValue |
26
|
|
|
* @ORM\Column(type="integer") |
27
|
|
|
**/ |
28
|
|
|
protected $id; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var int |
32
|
|
|
* |
33
|
|
|
* @ORM\Column(type="integer", unique=true) |
34
|
|
|
*/ |
35
|
|
|
protected $externalId; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var string|null |
39
|
|
|
* |
40
|
|
|
* @ORM\Column(nullable=true, type="string", length=3) |
41
|
|
|
*/ |
42
|
|
|
protected $feeCurrency; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var int|null |
46
|
|
|
* |
47
|
|
|
* @ORM\Column(nullable=true, type="integer") |
48
|
|
|
*/ |
49
|
|
|
protected $feeAmount; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var bool|null |
53
|
|
|
* |
54
|
|
|
* @ORM\Column(nullable=true, type="boolean") |
55
|
|
|
*/ |
56
|
|
|
protected $feeInclVat; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var string|null |
60
|
|
|
* |
61
|
|
|
* @ORM\Column(nullable=true, type="string", length=191) |
62
|
|
|
*/ |
63
|
|
|
protected $name; |
64
|
|
|
|
65
|
|
|
public function __toString() |
66
|
|
|
{ |
67
|
|
|
return (string) $this->name; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return int |
72
|
|
|
*/ |
73
|
|
|
public function getId(): int |
74
|
|
|
{ |
75
|
|
|
return (int) $this->id; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param int $id |
80
|
|
|
* |
81
|
|
|
* @return PaymentMethodInterface |
82
|
|
|
*/ |
83
|
|
|
public function setId($id) |
84
|
|
|
{ |
85
|
|
|
$this->id = $id; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return int |
92
|
|
|
*/ |
93
|
|
|
public function getExternalId(): int |
94
|
|
|
{ |
95
|
|
|
return (int) $this->externalId; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @param int $externalId |
100
|
|
|
* |
101
|
|
|
* @return PaymentMethodInterface |
102
|
|
|
*/ |
103
|
|
|
public function setExternalId($externalId) |
104
|
|
|
{ |
105
|
|
|
$this->externalId = $externalId; |
106
|
|
|
|
107
|
|
|
return $this; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @return Money|null |
112
|
|
|
*/ |
113
|
|
|
public function getFee(): ?Money |
114
|
|
|
{ |
115
|
|
|
if (!$this->feeCurrency) { |
116
|
|
|
return null; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
return new Money($this->feeAmount, new Currency($this->feeCurrency)); |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param Money $money |
124
|
|
|
* |
125
|
|
|
* @return PaymentMethodInterface |
126
|
|
|
*/ |
127
|
|
|
public function setFee(Money $money): PaymentMethodInterface |
128
|
|
|
{ |
129
|
|
|
$this->feeAmount = $money->getAmount(); |
|
|
|
|
130
|
|
|
$this->feeCurrency = $money->getCurrency()->getCode(); |
131
|
|
|
|
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return bool|null |
137
|
|
|
*/ |
138
|
|
|
public function getFeeInclVat() |
139
|
|
|
{ |
140
|
|
|
return $this->feeInclVat; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @param bool|null $feeInclVat |
145
|
|
|
* |
146
|
|
|
* @return PaymentMethodInterface |
147
|
|
|
*/ |
148
|
|
|
public function setFeeInclVat($feeInclVat) |
149
|
|
|
{ |
150
|
|
|
$this->feeInclVat = $feeInclVat; |
151
|
|
|
|
152
|
|
|
return $this; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @return null|string |
157
|
|
|
*/ |
158
|
|
|
public function getName() |
159
|
|
|
{ |
160
|
|
|
return $this->name; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @param null|string $name |
165
|
|
|
* |
166
|
|
|
* @return PaymentMethodInterface |
167
|
|
|
*/ |
168
|
|
|
public function setName($name) |
169
|
|
|
{ |
170
|
|
|
$this->name = $name; |
171
|
|
|
|
172
|
|
|
return $this; |
173
|
|
|
} |
174
|
|
|
} |
175
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths