calcinai / xero-php

A php library for the Xero API, with a cleaner OAuth interface and ORM-like abstraction.
MIT License
359 stars 262 forks source link

Attachment not working on BankTranfer #556

Open KimBev opened 5 years ago

KimBev commented 5 years ago

Hi, Your SDK is great, thanks for the effort in putting it together.

I am adding attachment to Invoices and it works fine, now I have tried adding an attachment to a BankTransfer but it does not seem to work, is this a known issue?

This is my code

$trf = new BankTransfer($xero);
$trf->setAmount(100);
$fromBank = new FromBankAccount($xero);
$fromBank->setCode(1234);
$trf->setFromBankAccount($fromBank);
$toBank = new ToBankAccount($xero);
$toBank->setCode($4567);
$trf->setToBankAccount($toBank);
$trf->setDate($date);
$trf->save();

$attachment = Attachment::createFromLocalFile($filePath,'text/csv');
$trf->addAttachment($attachment);

thanks Kim

calcinai commented 5 years ago

Hmm, are you getting any errors?

KimBev commented 5 years ago

Hi, no errors, I also printed out the raw response from AttachmentTrait->addAttachment and it seemed to be successful. But when I got Xero the attachment is not present on the bank transfer transaction.

KimBev commented 5 years ago

Hi, did you have any luck replicating this behaviour? I can activate some debugging or something if you need.

KimBev commented 5 years ago

Hi, Any ideas on this one?