1 | <?php |
||
16 | class PaymentInformation |
||
17 | { |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $id; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $transactions; |
||
27 | |||
28 | /** |
||
29 | * @var bool |
||
30 | */ |
||
31 | protected $batchBooking; |
||
32 | |||
33 | /** |
||
34 | * @var string|null |
||
35 | */ |
||
36 | protected $serviceLevel; |
||
37 | |||
38 | /** |
||
39 | * @var string|null |
||
40 | */ |
||
41 | protected $localInstrument; |
||
42 | |||
43 | /** |
||
44 | * @var \DateTime |
||
45 | */ |
||
46 | protected $executionDate; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $debtorName; |
||
52 | |||
53 | /** |
||
54 | * @var FinancialInstitutionInterface |
||
55 | */ |
||
56 | protected $debtorAgent; |
||
57 | |||
58 | /** |
||
59 | * @var IBAN |
||
60 | */ |
||
61 | protected $debtorIBAN; |
||
62 | |||
63 | /** |
||
64 | * @var IntermediarySwift |
||
65 | */ |
||
66 | protected $intermediarySwift; |
||
67 | |||
68 | /** |
||
69 | * Constructor |
||
70 | * |
||
71 | * @param string $id Identifier of this group (should be unique within a message) |
||
72 | * @param string $debtorName Name of the debtor |
||
73 | * @param BC|BIC $debtorAgent BC or BIC of the debtor's financial institution |
||
74 | * @param IBAN $debtorIBAN IBAN of the debtor's account |
||
75 | */ |
||
76 | 3 | public function __construct($id, $debtorName, FinancialInstitutionInterface $debtorAgent, IBAN $debtorIBAN) |
|
90 | |||
91 | /** |
||
92 | * Adds a single transaction to this payment |
||
93 | * |
||
94 | * @param CreditTransfer $transaction The transaction to be added |
||
95 | * |
||
96 | * @return PaymentInformation This payment instruction |
||
97 | */ |
||
98 | 2 | public function addTransaction(CreditTransfer $transaction) |
|
104 | |||
105 | /** |
||
106 | * Gets the number of transactions |
||
107 | * |
||
108 | * @return int Number of transactions |
||
109 | */ |
||
110 | 2 | public function getTransactionCount() |
|
114 | |||
115 | /** |
||
116 | * Gets the sum of transactions |
||
117 | * |
||
118 | * @return Money\Mixed Sum of transactions |
||
119 | */ |
||
120 | 2 | public function getTransactionSum() |
|
130 | |||
131 | /** |
||
132 | * Sets the required execution date. |
||
133 | * Where appropriate, the value data is automatically modified to the next possible banking/Post Office working day. |
||
134 | * |
||
135 | * @param \DateTime $executionDate |
||
136 | * |
||
137 | * @return PaymentInformation This payment instruction |
||
138 | */ |
||
139 | public function setExecutionDate(\DateTime $executionDate) |
||
145 | |||
146 | /** |
||
147 | * Sets the batch booking option. |
||
148 | * It is recommended that one payment instruction is created for each currency transferred. |
||
149 | * |
||
150 | * @param bool $batchBooking |
||
151 | * |
||
152 | * @return PaymentInformation This payment instruction |
||
153 | */ |
||
154 | public function setBatchBooking($batchBooking) |
||
160 | |||
161 | /** |
||
162 | * Checks whether the payment type information is included on B- or C-level |
||
163 | * |
||
164 | * @return bool true if it is included on B-level |
||
165 | */ |
||
166 | 4 | public function hasPaymentTypeInformation() |
|
170 | |||
171 | /** |
||
172 | * Gets the local instrument |
||
173 | * |
||
174 | * @return string|null The local instrument |
||
175 | */ |
||
176 | 2 | public function getLocalInstrument() |
|
180 | |||
181 | /** |
||
182 | * Gets the service level |
||
183 | * |
||
184 | * @return string|null The service level |
||
185 | */ |
||
186 | 2 | public function getServiceLevel() |
|
190 | |||
191 | public function addIntermediarySwift(IntermediarySwift $intermediarySwift) |
||
195 | |||
196 | /** |
||
197 | * Builds a DOM tree of this payment instruction |
||
198 | * |
||
199 | * @param \DOMDocument $doc |
||
200 | * |
||
201 | * @return \DOMElement The built DOM tree |
||
202 | */ |
||
203 | 4 | public function asDom(\DOMDocument $doc) |
|
248 | } |
||
249 |