1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Loevgaard\DandomainAltapayBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
7
|
|
|
use Loevgaard\Dandomain\Pay\PaymentRequest; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* The Payment entity is a special entity since it maps a payment from the Dandomain Payment API |
11
|
|
|
* This is also the reason why it doesn't implement an interface but extends the PaymentRequest |
12
|
|
|
* from the Dandomain Pay PHP SDK. |
13
|
|
|
* |
14
|
|
|
* Also it doesn't relate to any other entities other than PaymentLine since the Dandomain Payment API |
15
|
|
|
* POST request is not complete with all information needed to populate all the related entities, i.e. customers, |
16
|
|
|
* deliveries etc. |
17
|
|
|
* |
18
|
|
|
* @ORM\MappedSuperclass |
19
|
|
|
*/ |
20
|
|
|
abstract class Payment extends PaymentRequest |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var int |
24
|
|
|
* |
25
|
|
|
* @ORM\Column(type="integer") |
26
|
|
|
*/ |
27
|
|
|
protected $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @ORM\Column(type="string") |
31
|
|
|
*/ |
32
|
|
|
protected $apiKey; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @ORM\Column(type="string") |
36
|
|
|
*/ |
37
|
|
|
protected $merchant; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @ORM\Column(type="integer") |
41
|
|
|
*/ |
42
|
|
|
protected $orderId; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @ORM\Column(type="text") |
46
|
|
|
*/ |
47
|
|
|
protected $sessionId; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @ORM\Column(type="string") |
51
|
|
|
*/ |
52
|
|
|
protected $currencySymbol; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @ORM\Column(type="decimal", precision=12, scale=2) |
56
|
|
|
*/ |
57
|
|
|
protected $totalAmount; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @ORM\Column(type="string") |
61
|
|
|
*/ |
62
|
|
|
protected $callBackUrl; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @ORM\Column(type="string") |
66
|
|
|
*/ |
67
|
|
|
protected $fullCallBackOkUrl; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @ORM\Column(type="string") |
71
|
|
|
*/ |
72
|
|
|
protected $callBackOkUrl; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @ORM\Column(type="string") |
76
|
|
|
*/ |
77
|
|
|
protected $callBackServerUrl; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @ORM\Column(type="integer") |
81
|
|
|
*/ |
82
|
|
|
protected $languageId; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @ORM\Column(type="string") |
86
|
|
|
*/ |
87
|
|
|
protected $testMode; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @ORM\Column(type="integer") |
91
|
|
|
*/ |
92
|
|
|
protected $paymentGatewayCurrencyCode; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @ORM\Column(type="integer") |
96
|
|
|
*/ |
97
|
|
|
protected $cardTypeId; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @ORM\Column(type="string") |
101
|
|
|
*/ |
102
|
|
|
protected $customerRekvNr; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @ORM\Column(type="string") |
106
|
|
|
*/ |
107
|
|
|
protected $customerName; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @ORM\Column(type="string") |
111
|
|
|
*/ |
112
|
|
|
protected $customerCompany; |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @ORM\Column(type="string") |
116
|
|
|
*/ |
117
|
|
|
protected $customerAddress; |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @ORM\Column(type="string") |
121
|
|
|
*/ |
122
|
|
|
protected $customerAddress2; |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @ORM\Column(type="string") |
126
|
|
|
*/ |
127
|
|
|
protected $customerZipCode; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @ORM\Column(type="string") |
131
|
|
|
*/ |
132
|
|
|
protected $customerCity; |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @ORM\Column(type="integer") |
136
|
|
|
*/ |
137
|
|
|
protected $customerCountryId; |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @ORM\Column(type="string") |
141
|
|
|
*/ |
142
|
|
|
protected $customerCountry; |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @ORM\Column(type="string") |
146
|
|
|
*/ |
147
|
|
|
protected $customerPhone; |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @ORM\Column(type="string") |
151
|
|
|
*/ |
152
|
|
|
protected $customerFax; |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @ORM\Column(type="string") |
156
|
|
|
*/ |
157
|
|
|
protected $customerEmail; |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @ORM\Column(type="string") |
161
|
|
|
*/ |
162
|
|
|
protected $customerNote; |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @ORM\Column(type="string") |
166
|
|
|
*/ |
167
|
|
|
protected $customerCvrnr; |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* @ORM\Column(type="integer") |
171
|
|
|
*/ |
172
|
|
|
protected $customerCustTypeId; |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @ORM\Column(type="string") |
176
|
|
|
*/ |
177
|
|
|
protected $customerEan; |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @ORM\Column(type="string") |
181
|
|
|
*/ |
182
|
|
|
protected $customerRes1; |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @ORM\Column(type="string") |
186
|
|
|
*/ |
187
|
|
|
protected $customerRes2; |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* @ORM\Column(type="string") |
191
|
|
|
*/ |
192
|
|
|
protected $customerRes3; |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* @ORM\Column(type="string") |
196
|
|
|
*/ |
197
|
|
|
protected $customerRes4; |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @ORM\Column(type="string") |
201
|
|
|
*/ |
202
|
|
|
protected $customerRes5; |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @ORM\Column(type="string") |
206
|
|
|
*/ |
207
|
|
|
protected $customerIp; |
208
|
|
|
|
209
|
|
|
/** |
210
|
|
|
* @ORM\Column(type="string") |
211
|
|
|
*/ |
212
|
|
|
protected $deliveryName; |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @ORM\Column(type="string") |
216
|
|
|
*/ |
217
|
|
|
protected $deliveryCompany; |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @ORM\Column(type="string") |
221
|
|
|
*/ |
222
|
|
|
protected $deliveryAddress; |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @ORM\Column(type="string") |
226
|
|
|
*/ |
227
|
|
|
protected $deliveryAddress2; |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* @ORM\Column(type="string") |
231
|
|
|
*/ |
232
|
|
|
protected $deliveryZipCode; |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* @ORM\Column(type="string") |
236
|
|
|
*/ |
237
|
|
|
protected $deliveryCity; |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* @ORM\Column(type="integer") |
241
|
|
|
*/ |
242
|
|
|
protected $deliveryCountryID; |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @ORM\Column(type="string") |
246
|
|
|
*/ |
247
|
|
|
protected $deliveryCountry; |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* @ORM\Column(type="string") |
251
|
|
|
*/ |
252
|
|
|
protected $deliveryPhone; |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @ORM\Column(type="string") |
256
|
|
|
*/ |
257
|
|
|
protected $deliveryFax; |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* @ORM\Column(type="string") |
261
|
|
|
*/ |
262
|
|
|
protected $deliveryEmail; |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @ORM\Column(type="string") |
266
|
|
|
*/ |
267
|
|
|
protected $deliveryEan; |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* @ORM\Column(type="string") |
271
|
|
|
*/ |
272
|
|
|
protected $shippingMethod; |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* @ORM\Column(type="decimal", precision=12, scale=2) |
276
|
|
|
*/ |
277
|
|
|
protected $shippingFee; |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @ORM\Column(type="string") |
281
|
|
|
*/ |
282
|
|
|
protected $paymentMethod; |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* @ORM\Column(type="decimal", precision=12, scale=2) |
286
|
|
|
*/ |
287
|
|
|
protected $paymentFee; |
288
|
|
|
|
289
|
|
|
/** |
290
|
|
|
* @ORM\Column(type="string") |
291
|
|
|
*/ |
292
|
|
|
protected $loadBalancerRealIp; |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* @var string |
296
|
|
|
* |
297
|
|
|
* @ORM\Column(type="string") |
298
|
|
|
*/ |
299
|
|
|
protected $referrer; |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* @ORM\OneToMany(targetEntity="PaymentLine", mappedBy="payment") |
303
|
|
|
*/ |
304
|
|
|
protected $paymentLines; |
305
|
|
|
|
306
|
|
|
/** |
307
|
|
|
* Use this property to save the status for the payment. |
308
|
|
|
* |
309
|
|
|
* @var string |
310
|
|
|
* |
311
|
|
|
* @ORM\Column(type="string", nullable=true) |
312
|
|
|
*/ |
313
|
|
|
protected $status; |
314
|
|
|
|
315
|
|
|
/** |
316
|
|
|
* @var string |
317
|
|
|
* |
318
|
|
|
* @ORM\Column(type="string", nullable=true) |
319
|
|
|
*/ |
320
|
|
|
protected $altapayId; |
321
|
|
|
|
322
|
|
|
public function __construct() |
323
|
|
|
{ |
324
|
|
|
parent::__construct(); |
325
|
|
|
|
326
|
|
|
$this->paymentLines = new ArrayCollection(); |
327
|
|
|
} |
328
|
|
|
|
329
|
|
|
/** |
330
|
|
|
* @return int |
331
|
|
|
*/ |
332
|
|
|
public function getId() : int |
333
|
|
|
{ |
334
|
|
|
return $this->id; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @param int $id |
339
|
|
|
* |
340
|
|
|
* @return Payment |
341
|
|
|
*/ |
342
|
|
|
public function setId(int $id) : self |
343
|
|
|
{ |
344
|
|
|
$this->id = $id; |
345
|
|
|
|
346
|
|
|
return $this; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* @return string |
351
|
|
|
*/ |
352
|
|
|
public function getStatus() : string |
353
|
|
|
{ |
354
|
|
|
return $this->status; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @param string $status |
359
|
|
|
* |
360
|
|
|
* @return Payment |
361
|
|
|
*/ |
362
|
|
|
public function setStatus(string $status) : self |
363
|
|
|
{ |
364
|
|
|
$this->status = $status; |
365
|
|
|
|
366
|
|
|
return $this; |
367
|
|
|
} |
368
|
|
|
|
369
|
|
|
/** |
370
|
|
|
* @return string |
371
|
|
|
*/ |
372
|
|
|
public function getAltapayId() : string |
373
|
|
|
{ |
374
|
|
|
return $this->altapayId; |
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
/** |
378
|
|
|
* @param string $altapayId |
379
|
|
|
* @return Payment |
380
|
|
|
*/ |
381
|
|
|
public function setAltapayId(string $altapayId) : self |
382
|
|
|
{ |
383
|
|
|
$this->altapayId = $altapayId; |
384
|
|
|
|
385
|
|
|
return $this; |
386
|
|
|
} |
387
|
|
|
} |
388
|
|
|
|