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 $ultimateDebtorName; |
||
44 | |||
45 | /** |
||
46 | * @var PostalAddressInterface|null |
||
47 | */ |
||
48 | protected $ultimateDebtorAddress; |
||
49 | |||
50 | /** |
||
51 | * @var string|null |
||
52 | */ |
||
53 | protected $localInstrument; |
||
54 | |||
55 | /** |
||
56 | * @var string|null |
||
57 | */ |
||
58 | protected $serviceLevel; |
||
59 | |||
60 | /** |
||
61 | * @var PurposeCode|null |
||
62 | */ |
||
63 | protected $purpose; |
||
64 | |||
65 | /** |
||
66 | * @var RemittanceInformation|null |
||
67 | */ |
||
68 | protected $remittanceInformation; |
||
69 | |||
70 | /** |
||
71 | * Constructor |
||
72 | * |
||
73 | * @param string $instructionId Identifier of the instruction (should be unique within the message) |
||
74 | * @param string $endToEndId End-To-End Identifier of the instruction (passed unchanged along the complete processing chain) |
||
75 | * @param Money $amount Amount of money to be transferred |
||
76 | * @param string $creditorName Name of the creditor |
||
77 | * @param PostalAddressInterface $creditorAddress Address of the creditor |
||
78 | */ |
||
79 | 2 | public function __construct($instructionId, $endToEndId, Money $amount, $creditorName, PostalAddressInterface $creditorAddress) |
|
87 | |||
88 | /** |
||
89 | * Gets the local instrument |
||
90 | * |
||
91 | * @return string|null The local instrument |
||
92 | */ |
||
93 | 2 | public function getLocalInstrument() |
|
97 | |||
98 | /** |
||
99 | * Gets the service level |
||
100 | * |
||
101 | * @return string|null The service level |
||
102 | */ |
||
103 | 2 | public function getServiceLevel() |
|
107 | |||
108 | /** |
||
109 | * Sets the purpose of the payment |
||
110 | * |
||
111 | * @param PurposeCode $purpose The purpose |
||
112 | * |
||
113 | * @return CreditTransfer This credit transfer |
||
114 | */ |
||
115 | 2 | public function setPurpose(PurposeCode $purpose) |
|
121 | |||
122 | /** |
||
123 | * Gets the charge bearer |
||
124 | * |
||
125 | * @return string|null The charge bearer |
||
126 | */ |
||
127 | 2 | public function getChargeBearer() |
|
131 | |||
132 | /** |
||
133 | * Sets the ultimate debtor's name |
||
134 | * |
||
135 | * @param string|null $name |
||
136 | * |
||
137 | * @return self |
||
138 | */ |
||
139 | 2 | public function setUltimateDebtorName($name) |
|
145 | |||
146 | /** |
||
147 | * Sets the ultimate debtor's address |
||
148 | * |
||
149 | * @param PostalAddressInterface|null $address |
||
150 | * |
||
151 | * @return self |
||
152 | */ |
||
153 | 2 | public function setUltimateDebtorAddress(PostalAddressInterface $address) |
|
159 | |||
160 | /** |
||
161 | * Sets the remittance information |
||
162 | * |
||
163 | * @param RemittanceInformation|null $remittanceInformation |
||
164 | * |
||
165 | * @return self |
||
166 | */ |
||
167 | 2 | public function setRemittanceInformation(RemittanceInformation $remittanceInformation) |
|
173 | |||
174 | /** |
||
175 | * Gets the instructed amount of this transaction |
||
176 | * |
||
177 | * @return Money The instructed amount |
||
178 | */ |
||
179 | 2 | public function getAmount() |
|
183 | |||
184 | /** |
||
185 | * Builds a DOM tree of this transaction |
||
186 | * |
||
187 | * @param \DOMDocument $doc |
||
188 | * @param PaymentInformation $paymentInformation Information on B-level |
||
189 | * |
||
190 | * @return \DOMElement The built DOM tree |
||
191 | */ |
||
192 | abstract public function asDom(\DOMDocument $doc, PaymentInformation $paymentInformation); |
||
193 | |||
194 | /** |
||
195 | * Builds a DOM tree of this transaction and adds header nodes |
||
196 | * |
||
197 | * @param \DOMDocument $doc |
||
198 | * @param PaymentInformation $paymentInformation The corresponding B-level element |
||
199 | * |
||
200 | * @return \DOMNode The built DOM node |
||
201 | */ |
||
202 | 2 | protected function buildHeader(\DOMDocument $doc, PaymentInformation $paymentInformation, $chargeBearer = null) |
|
249 | |||
250 | /** |
||
251 | * Builds a DOM node of the Creditor field |
||
252 | * |
||
253 | * @param \DOMDocument $doc |
||
254 | * |
||
255 | * @return \DOMNode The built DOM node |
||
256 | */ |
||
257 | 2 | protected function buildCreditor(\DOMDocument $doc) |
|
265 | |||
266 | /** |
||
267 | * Appends the purpose to the transaction |
||
268 | * |
||
269 | * @param \DOMDocument $doc |
||
270 | * @param \DOMElement $transaction |
||
271 | */ |
||
272 | 2 | protected function appendPurpose(\DOMDocument $doc, \DOMElement $transaction) |
|
280 | |||
281 | /** |
||
282 | * Appends the remittance information to the transaction |
||
283 | * |
||
284 | * @param \DOMDocument $doc |
||
285 | * @param \DOMElement $transaction |
||
286 | */ |
||
287 | 2 | protected function appendRemittanceInformation(\DOMDocument $doc, \DOMElement $transaction) |
|
295 | } |
||
296 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.