1
|
|
|
<?php |
2
|
|
|
namespace Omnipay\EpsomAdelante; |
3
|
|
|
|
4
|
|
|
use Omnipay\Common\Item as BaseItem; |
5
|
|
|
|
6
|
|
|
class Item extends BaseItem |
7
|
|
|
{ |
8
|
|
|
/** |
9
|
|
|
* Fund code of the item |
10
|
|
|
*/ |
11
|
2 |
|
public function getFundCode() |
12
|
|
|
{ |
13
|
2 |
|
return $this->getParameter('fundCode'); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Set the item fund code |
18
|
|
|
*/ |
19
|
4 |
|
public function setFundCode($value) |
20
|
|
|
{ |
21
|
4 |
|
return $this->setParameter('fundCode', $value); |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Custom reference 1 of the item |
26
|
|
|
*/ |
27
|
2 |
|
public function getCustRef1() |
28
|
|
|
{ |
29
|
2 |
|
return $this->getParameter('custRef1'); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Set the item custom reference 1 |
34
|
|
|
*/ |
35
|
1 |
|
public function setCustRef1($value) |
36
|
|
|
{ |
37
|
1 |
|
return $this->setParameter('custRef1', $value); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Custom reference 2 of the item |
42
|
|
|
*/ |
43
|
2 |
|
public function getCustRef2() |
44
|
|
|
{ |
45
|
2 |
|
return $this->getParameter('custRef2'); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Set the item custom reference 2 |
50
|
|
|
*/ |
51
|
1 |
|
public function setCustRef2($value) |
52
|
|
|
{ |
53
|
1 |
|
return $this->setParameter('custRef2', $value); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Custom reference 3 of the item |
58
|
|
|
*/ |
59
|
2 |
|
public function getCustRef3() |
60
|
|
|
{ |
61
|
2 |
|
return $this->getParameter('custRef3'); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Set the item custom reference 3 |
66
|
|
|
*/ |
67
|
1 |
|
public function setCustRef3($value) |
68
|
|
|
{ |
69
|
1 |
|
return $this->setParameter('custRef3', $value); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Custom reference 4 of the item |
74
|
|
|
*/ |
75
|
2 |
|
public function getCustRef4() |
76
|
|
|
{ |
77
|
2 |
|
return $this->getParameter('custRef4'); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Set the item custom reference 4 |
82
|
|
|
*/ |
83
|
1 |
|
public function setCustRef4($value) |
84
|
|
|
{ |
85
|
1 |
|
return $this->setParameter('custRef4', $value); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* {@inheritDoc} |
90
|
|
|
* |
91
|
|
|
* In addition, enforces price is integer value |
92
|
|
|
*/ |
93
|
4 |
|
public function setPrice($value) |
94
|
|
|
{ |
95
|
|
|
// @todo would be nicer if this could be done with AbstractRequest currency functions (or similar) |
96
|
4 |
|
if (is_float($value) || (is_string($value) && strpos($value, '.') !== false)) { |
97
|
4 |
|
$value = (int) round($value * 100); |
98
|
4 |
|
} else { |
99
|
1 |
|
$value = (int) $value; |
100
|
|
|
} |
101
|
|
|
|
102
|
4 |
|
return parent::setPrice($value); |
103
|
|
|
} |
104
|
|
|
} |
105
|
|
|
|