1 | <?php |
||
11 | abstract class CreditTransfer |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $instructionId; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $endToEndId; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $creditorName; |
||
27 | |||
28 | /** |
||
29 | * @var PostalAddressInterface |
||
30 | */ |
||
31 | protected $creditorAddress; |
||
32 | |||
33 | /** |
||
34 | * @var Money |
||
35 | */ |
||
36 | protected $amount; |
||
37 | |||
38 | /** |
||
39 | * @var string|null |
||
40 | */ |
||
41 | protected $remittanceInformation; |
||
42 | |||
43 | /** |
||
44 | * Constructor |
||
45 | * |
||
46 | * @param string $instructionId Identifier of the instruction (should be unique within the message) |
||
47 | * @param string $endToEndId End-To-End Identifier of the instruction (passed unchanged along the complete processing chain) |
||
48 | * @param Money $amount Amount of money to be transferred |
||
49 | * @param string $creditorName Name of the creditor |
||
50 | * @param PostalAddressInterface $creditorAddress Address of the creditor |
||
51 | */ |
||
52 | 2 | public function __construct($instructionId, $endToEndId, Money $amount, $creditorName, PostalAddressInterface $creditorAddress) |
|
61 | |||
62 | /** |
||
63 | * Sets the unstructured remittance information |
||
64 | * |
||
65 | * @param string|null $remittanceInformation |
||
66 | * |
||
67 | * @return CreditTransfer This credit transfer |
||
68 | */ |
||
69 | public function setRemittanceInformation($remittanceInformation) |
||
75 | |||
76 | /** |
||
77 | * Gets the instructed amount of this transaction |
||
78 | * |
||
79 | * @return Money The instructed amount |
||
80 | */ |
||
81 | 2 | public function getAmount() |
|
85 | |||
86 | /** |
||
87 | * Builds a DOM tree of this transaction |
||
88 | * |
||
89 | * @param \DOMDocument $doc |
||
90 | * |
||
91 | * @return \DOMElement The built DOM tree |
||
92 | */ |
||
93 | abstract public function asDom(\DOMDocument $doc); |
||
94 | |||
95 | /** |
||
96 | * Builds a DOM tree of this transaction and adds header nodes |
||
97 | * |
||
98 | * @param \DOMDocument $doc |
||
99 | * @param string|null $localInstrument Local Instrument |
||
100 | * @param string|null $serviceLevel |
||
101 | * |
||
102 | * @return \DOMNode The built DOM node |
||
103 | */ |
||
104 | 2 | protected function buildHeader(\DOMDocument $doc, $localInstrument = null, $serviceLevel = null) |
|
136 | |||
137 | /** |
||
138 | * Builds a DOM node of the Creditor field |
||
139 | * |
||
140 | * @param \DOMDocument $doc |
||
141 | * |
||
142 | * @return \DOMNode The built DOM node |
||
143 | */ |
||
144 | 2 | protected function buildCreditor(\DOMDocument $doc) |
|
152 | |||
153 | /** |
||
154 | * Indicates whether remittance information is set |
||
155 | * |
||
156 | * @return bool true if remittance information is set |
||
157 | */ |
||
158 | 2 | protected function hasRemittanceInformation() |
|
162 | |||
163 | /** |
||
164 | * Builds a DOM node of the Remittance Information field |
||
165 | * |
||
166 | * @param \DOMDocument $doc |
||
167 | * |
||
168 | * @return \DOMNode The built DOM node |
||
169 | * |
||
170 | * @throws \LogicException When no remittance information is set |
||
171 | */ |
||
172 | protected function buildRemittanceInformation(\DOMDocument $doc) |
||
183 | } |
||
184 |