File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/Picqer/Financials/Moneybird/Entities Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -204,19 +204,23 @@ public function duplicateToCreditInvoice()
204204 /**
205205 * Add Attachment to this invoice
206206 *
207- * @param string $file
207+ * You can use fopen('/path/to/file', 'r') in $resource.
208+ *
209+ * @param string $filename The filename of the attachment
210+ * @param resource $contents A StreamInterface/resource/string, @see http://docs.guzzlephp.org/en/stable/request-options.html?highlight=multipart#multipart
208211 *
209212 * @return \Picqer\Financials\Moneybird\Entities\SalesInvoice
210213 *
211214 * @throws \Picqer\Financials\Moneybird\Exceptions\ApiException
212215 */
213- public function addAttachment ($ file )
216+ public function addAttachment ($ filename , $ contents )
214217 {
215218 $ this ->connection ()->upload ($ this ->endpoint . '/ ' . $ this ->id . '/attachments ' , [
216219 'multipart ' => [
217220 [
218221 'name ' => 'file ' ,
219- 'contents ' => fopen ($ file , 'r ' ),
222+ 'contents ' => $ contents ,
223+ 'filename ' => $ filename ,
220224 ],
221225 ]
222226 ]);
You can’t perform that action at this time.
0 commit comments