1 | <?php |
||
13 | abstract class CreditTransfer |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $instructionId; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $endToEndId; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $creditorName; |
||
29 | |||
30 | /** |
||
31 | * @var PostalAddressInterface |
||
32 | */ |
||
33 | protected $creditorAddress; |
||
34 | |||
35 | /** |
||
36 | * @var Money |
||
37 | */ |
||
38 | protected $amount; |
||
39 | |||
40 | /** |
||
41 | * @var string|null |
||
42 | */ |
||
43 | protected $remittanceInformation; |
||
44 | |||
45 | /** |
||
46 | * @var IntermediarySwift |
||
47 | */ |
||
48 | protected $intermediarySwift; |
||
49 | |||
50 | /** |
||
51 | * Constructor |
||
52 | * |
||
53 | * @param string $instructionId Identifier of the instruction (should be unique within the message) |
||
54 | * @param string $endToEndId End-To-End Identifier of the instruction (passed unchanged along the complete processing chain) |
||
55 | * @param Money $amount Amount of money to be transferred |
||
56 | * @param string $creditorName Name of the creditor |
||
57 | * @param PostalAddressInterface $creditorAddress Address of the creditor |
||
58 | * @param IntermediarySwift $intermediarySwift |
||
59 | */ |
||
60 | 3 | public function __construct($instructionId, $endToEndId, Money $amount, $creditorName, PostalAddressInterface $creditorAddress, $intermediarySwift = null) |
|
72 | |||
73 | /** |
||
74 | * Sets the unstructured remittance information |
||
75 | * |
||
76 | * @param string|null $remittanceInformation |
||
77 | * |
||
78 | * @return CreditTransfer This credit transfer |
||
79 | */ |
||
80 | public function setRemittanceInformation($remittanceInformation) |
||
86 | |||
87 | /** |
||
88 | * Gets the instructed amount of this transaction |
||
89 | * |
||
90 | * @return Money The instructed amount |
||
91 | */ |
||
92 | 2 | public function getAmount() |
|
96 | |||
97 | /** |
||
98 | * Builds a DOM tree of this transaction |
||
99 | * |
||
100 | * @param \DOMDocument $doc |
||
101 | * @param PaymentInformation $paymentInformation Information on B-level |
||
102 | * |
||
103 | * @return \DOMElement The built DOM tree |
||
104 | */ |
||
105 | abstract public function asDom(\DOMDocument $doc, PaymentInformation $paymentInformation); |
||
106 | |||
107 | /** |
||
108 | * Builds a DOM tree of this transaction and adds header nodes |
||
109 | * |
||
110 | * @param \DOMDocument $doc |
||
111 | * @param PaymentInformation $paymentInformation The corresponding B-level element |
||
112 | * @param string|null $localInstrument Local instrument |
||
113 | * @param string|null $serviceLevel Service level |
||
114 | * |
||
115 | * @return \DOMNode The built DOM node |
||
116 | */ |
||
117 | 2 | protected function buildHeader(\DOMDocument $doc, PaymentInformation $paymentInformation, $localInstrument = null, $serviceLevel = null) |
|
156 | |||
157 | /** |
||
158 | * Builds a DOM node of the Creditor field |
||
159 | * |
||
160 | * @param \DOMDocument $doc |
||
161 | * |
||
162 | * @return \DOMNode The built DOM node |
||
163 | */ |
||
164 | 2 | protected function buildCreditor(\DOMDocument $doc) |
|
172 | |||
173 | /** |
||
174 | * Indicates whether remittance information is set |
||
175 | * |
||
176 | * @return bool true if remittance information is set |
||
177 | */ |
||
178 | 2 | protected function hasRemittanceInformation() |
|
182 | |||
183 | /** |
||
184 | * Builds a DOM node of the Remittance Information field |
||
185 | * |
||
186 | * @param \DOMDocument $doc |
||
187 | * |
||
188 | * @return \DOMNode The built DOM node |
||
189 | * |
||
190 | * @throws \LogicException When no remittance information is set |
||
191 | */ |
||
192 | protected function buildRemittanceInformation(\DOMDocument $doc) |
||
203 | |||
204 | /** |
||
205 | * @return IntermediarySwift |
||
206 | */ |
||
207 | 1 | public function getIntermediarySwift() |
|
211 | |||
212 | /** |
||
213 | * @param IntermediarySwift $intermediarySwift |
||
214 | */ |
||
215 | 1 | public function setIntermediarySwift(IntermediarySwift $intermediarySwift) |
|
219 | } |
||
220 |