Closed kieranheadley closed 7 years ago
Good question! I'm not actually sure on this specific functionality - perhaps @amochohan could shed some light on this?
From what I can see there's a facade for the payment in there..
Not had a response from Amo Chohan, how would you complete this using your library?
Here's how we push a payment against a Xero invoice using the xero-php library. ` $invoice_obj = new \XeroPHP\Models\Accounting\Invoice($xero->getInstance()); $invoice_obj->setInvoiceID($invoice_guid);
$newPayment = new \XeroPHP\Models\Accounting\Payment();
$newPayment
->setInvoice($invoice_obj)
->setAccount($currency)
->setDate($date_time_obj)
->setAmount($amount)
->setIsReconciled(true)
->setReference('Payment '.$payment->reference);
$posted_payment = $xero->save($newPayment);`
I've toned down some of our values but hopefully this gives you the gist?
That worked perfectly, thank you so much @williamrenfrew
Thanks @williamrenfrew for clarifying that. Maybe it's time for some more docs! as in #86...
I am using the Xero Laravel wrapper (https://github.com/amochohan/xerolaravel) and want to record payments made against an invoice. I can get the invoice but cannot find how to record a payment using the Laravel Wrapper provided;
I have tried a couple of solutions but none seem to work;
The above returns the issue
I can find the Xero documentation but this doesn't help to how it could translate into Laravel. It may be that the wrapper doesn't have this functionality built in, if so how would I complete using https://github.com/calcinai/xero-php which the wrapper is based on?