1 | <?php |
||
21 | class PaymentInformation |
||
22 | { |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $id; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $transactions; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | protected $batchBooking; |
||
37 | |||
38 | /** |
||
39 | * @var string|null |
||
40 | */ |
||
41 | protected $serviceLevel; |
||
42 | |||
43 | /** |
||
44 | * @var string|null |
||
45 | */ |
||
46 | protected $localInstrument; |
||
47 | |||
48 | /** |
||
49 | * @var CategoryPurposeCode|null |
||
50 | */ |
||
51 | protected $categoryPurpose; |
||
52 | |||
53 | /** |
||
54 | * @var DateTime |
||
55 | */ |
||
56 | protected $executionDate; |
||
57 | |||
58 | /** |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $debtorName; |
||
62 | |||
63 | /** |
||
64 | * @var FinancialInstitutionInterface |
||
65 | */ |
||
66 | protected $debtorAgent; |
||
67 | |||
68 | /** |
||
69 | * @var IBAN |
||
70 | */ |
||
71 | protected $debtorIBAN; |
||
72 | |||
73 | /** |
||
74 | * Constructor |
||
75 | * |
||
76 | * @param string $id Identifier of this group (should be unique within a message) |
||
77 | * @param string $debtorName Name of the debtor |
||
78 | * @param FinancialInstitutionInterface $debtorAgent BIC or IID of the debtor's financial institution |
||
79 | * @param IBAN $debtorIBAN IBAN of the debtor's account |
||
80 | * |
||
81 | */ |
||
82 | 4 | public function __construct($id, $debtorName, FinancialInstitutionInterface $debtorAgent, IBAN $debtorIBAN) |
|
96 | |||
97 | /** |
||
98 | * Adds a single transaction to this payment |
||
99 | * |
||
100 | * @param CreditTransfer $transaction The transaction to be added |
||
101 | * |
||
102 | * @return PaymentInformation This payment instruction |
||
103 | */ |
||
104 | 3 | public function addTransaction(CreditTransfer $transaction) |
|
110 | |||
111 | /** |
||
112 | * Gets the number of transactions |
||
113 | * |
||
114 | * @return int Number of transactions |
||
115 | */ |
||
116 | 2 | public function getTransactionCount() |
|
120 | |||
121 | /** |
||
122 | * Gets the sum of transactions |
||
123 | * |
||
124 | * @return Money\Mixed Sum of transactions |
||
125 | */ |
||
126 | 2 | public function getTransactionSum() |
|
136 | |||
137 | /** |
||
138 | * Sets the required execution date. |
||
139 | * Where appropriate, the value data is automatically modified to the next possible banking/Post Office working day. |
||
140 | * |
||
141 | * @param DateTime $executionDate |
||
142 | * |
||
143 | * @return PaymentInformation This payment instruction |
||
144 | */ |
||
145 | public function setExecutionDate(DateTime $executionDate) |
||
151 | |||
152 | /** |
||
153 | * Sets the batch booking option. |
||
154 | * It is recommended that one payment instruction is created for each currency transferred. |
||
155 | * |
||
156 | * @param bool $batchBooking |
||
157 | * |
||
158 | * @return PaymentInformation This payment instruction |
||
159 | */ |
||
160 | public function setBatchBooking($batchBooking) |
||
166 | |||
167 | /** |
||
168 | * Checks whether the payment type information is included on B- or C-level |
||
169 | * |
||
170 | * @return bool true if it is included on B-level |
||
171 | */ |
||
172 | 4 | public function hasPaymentTypeInformation() |
|
176 | |||
177 | /** |
||
178 | * Gets the local instrument |
||
179 | * |
||
180 | * @return string|null The local instrument |
||
181 | */ |
||
182 | public function getLocalInstrument() |
||
186 | |||
187 | /** |
||
188 | * Gets the service level |
||
189 | * |
||
190 | * @return string|null The service level |
||
191 | */ |
||
192 | public function getServiceLevel() |
||
196 | |||
197 | /** |
||
198 | * Sets the category purpose |
||
199 | * |
||
200 | * @param CategoryPurposeCode $categoryPurpose The category purpose |
||
201 | * |
||
202 | * @return PaymentInformation This payment instruction |
||
203 | */ |
||
204 | 3 | public function setCategoryPurpose(CategoryPurposeCode $categoryPurpose) |
|
210 | |||
211 | /** |
||
212 | * Builds a DOM tree of this payment instruction |
||
213 | * |
||
214 | * @param DOMDocument $doc |
||
215 | * |
||
216 | * @return DOMElement The built DOM tree |
||
217 | */ |
||
218 | 5 | public function asDom(DOMDocument $doc) |
|
281 | |||
282 | 2 | private function inferServiceLevel() |
|
290 | |||
291 | 2 | private function inferLocalInstrument() |
|
299 | } |
||
300 |