1 | <?php |
||
15 | class PaymentInformation |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $id; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $transactions; |
||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | protected $batchBooking; |
||
31 | |||
32 | /** |
||
33 | * @var string|null |
||
34 | */ |
||
35 | protected $serviceLevel; |
||
36 | |||
37 | /** |
||
38 | * @var string|null |
||
39 | */ |
||
40 | protected $localInstrument; |
||
41 | |||
42 | /** |
||
43 | * @var \DateTime |
||
44 | */ |
||
45 | protected $executionDate; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $debtorName; |
||
51 | |||
52 | /** |
||
53 | * @var FinancialInstitutionInterface |
||
54 | */ |
||
55 | protected $debtorAgent; |
||
56 | |||
57 | /** |
||
58 | * @var IBAN |
||
59 | */ |
||
60 | protected $debtorIBAN; |
||
61 | |||
62 | /** |
||
63 | * Constructor |
||
64 | * |
||
65 | * @param string $id Identifier of this group (should be unique within a message) |
||
66 | * @param string $debtorName Name of the debtor |
||
67 | * @param BC|BIC $debtorAgent BC or BIC of the debtor's financial institution |
||
68 | * @param IBAN $debtorIBAN IBAN of the debtor's account |
||
69 | */ |
||
70 | 3 | public function __construct($id, $debtorName, FinancialInstitutionInterface $debtorAgent, IBAN $debtorIBAN) |
|
84 | |||
85 | /** |
||
86 | * Adds a single transaction to this payment |
||
87 | * |
||
88 | * @param CreditTransfer $transaction The transaction to be added |
||
89 | * |
||
90 | * @return PaymentInformation This payment instruction |
||
91 | */ |
||
92 | 2 | public function addTransaction(CreditTransfer $transaction) |
|
98 | |||
99 | /** |
||
100 | * Gets the number of transactions |
||
101 | * |
||
102 | * @return int Number of transactions |
||
103 | */ |
||
104 | 2 | public function getTransactionCount() |
|
108 | |||
109 | /** |
||
110 | * Gets the sum of transactions |
||
111 | * |
||
112 | * @return Money\Mixed Sum of transactions |
||
113 | */ |
||
114 | 2 | public function getTransactionSum() |
|
124 | |||
125 | /** |
||
126 | * Sets the required execution date. |
||
127 | * Where appropriate, the value data is automatically modified to the next possible banking/Post Office working day. |
||
128 | * |
||
129 | * @param \DateTime $executionDate |
||
130 | * |
||
131 | * @return PaymentInformation This payment instruction |
||
132 | */ |
||
133 | public function setExecutionDate(\DateTime $executionDate) |
||
139 | |||
140 | /** |
||
141 | * Sets the batch booking option. |
||
142 | * It is recommended that one payment instruction is created for each currency transferred. |
||
143 | * |
||
144 | * @param bool $batchBooking |
||
145 | * |
||
146 | * @return PaymentInformation This payment instruction |
||
147 | */ |
||
148 | public function setBatchBooking($batchBooking) |
||
154 | |||
155 | /** |
||
156 | * Checks whether the payment type information is included on B- or C-level |
||
157 | * |
||
158 | * @return bool true if it is included on B-level |
||
159 | */ |
||
160 | 4 | public function hasPaymentTypeInformation() |
|
164 | |||
165 | /** |
||
166 | * Gets the local instrument |
||
167 | * |
||
168 | * @return string|null The local instrument |
||
169 | */ |
||
170 | 2 | public function getLocalInstrument() |
|
174 | |||
175 | /** |
||
176 | * Gets the service level |
||
177 | * |
||
178 | * @return string|null The service level |
||
179 | */ |
||
180 | 2 | public function getServiceLevel() |
|
184 | |||
185 | /** |
||
186 | * Builds a DOM tree of this payment instruction |
||
187 | * |
||
188 | * @param \DOMDocument $doc |
||
189 | * |
||
190 | * @return \DOMElement The built DOM tree |
||
191 | */ |
||
192 | 4 | public function asDom(\DOMDocument $doc) |
|
237 | } |
||
238 |