drpitman / php-xero Goto Github PK
View Code? Open in Web Editor NEWA php class to interact with the Xero API
A php class to interact with the Xero API
I'm trying to integrate your library into my CodeIgniter project, and get the following message:
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: libraries/xero.php
Line Number: 630
This is the code that is accessing the library:
include_once "xero.php"; define('XERO_KEY','BLABLA'); define('XERO_SECRET','BLABLA'); $xero = new Xero(XERO_KEY, XERO_SECRET, 'xero_keys/publickey.cer', 'xero_keys/privatekey.pem', 'xml'); return $xero->Contacts;
Keys replaced for security, any help would be greatly appreciated.
it took me a bit of playing around before I realized that the error:
Fatal error: Call to a member function get_name() on a non-object in /xero.php on line 784
Was being caused due to an incorrect path being given... would be nice if it had thrown an error at line 188 rather than just returning false.
For some reason that is all i get whenever i try and call anything from the api. What am i doing wrong? I am running PHP version 5.2.4-2
Hi
Your If Modified since header wasn't working - this is what works for me ie, set HEADER to True & Set HTTPHEADER to the value required:
if ( $modified_after ) {
curl_setopt($ch, CURLOPT_HTTPHEADER, array("If-Modified-Since: $modified_after"));
}
curl_setopt($ch, CURLINFO_HEADER, 1);
Hi,
Great work just a couple of niggles.
Seems that Items are supported in the class methods. You can add this quite simply by amending the valid methods arrays to include Items and it just works if you post the correct data.
In my experience with it you need the items in place within Xero to add an invoice line with an ItemCode.
I'm getting this error message when try to retrieve contact with parameters ContactID:
<xmp>
0
Operator '==' incompatible with operand types 'Guid' and 'String'
</xmp>
and when retrieve contact by using other parameters ("Name" etc), no information is returned:
<xmp>
6c5fbf40-0af2-4326-97eb-b384693f1e3b
OK
SXI-SHOPP XERO Private Integrator
2010-08-14T09:13:05.7253215Z
</xmp>
It was working before and this suddenly happened!
Hi there,
I'm just playing around with the PHP-Xero class at the moment - very cool stuff!
The only issue I've run into is that I'm not sure how to add more than one line item to an invoice. Obviously, rewriting the LineItem array each time just replaces the last LineItem. Have you got any ideas on a work-around for this?
Would really appreciate any thoughts!
Cheers,
Jamie.
What's the best way to check for an error response? If, for example, you make an API call that succeeds, but the request itself is an error, how should I check?
For example, if you try to create a new invoice when there is a pre-existing approved invoice, the entire API call itself "succeeds" but returns an error, which passes the is_object test that is at the bottom of the readme sample.
The return code looks like this:
SimpleXMLElement Object
(
[ErrorNumber] => 10
[Type] => ValidationException
[Message] => A validation exception occurred
[Elements] => SimpleXMLElement Object
(
[DataContractBase] => Array
(
...
Hai,
I am web developer, my client wants to integrate xero with his application, he has given XERO_KEY and XERO_SECRET.
Where can I get the files publickey.cer and privatekey.pem? Is these files are unique for every user of XERO? or common for all users.
Thanks.
I've had a crack, but can't work out how the library is handling tracking categories. Could you please add a tracking category to the example for posting an invoice? Thanks
Hi there
Can you help with the problem i am get to integrate php with xero.
i am download xero.php file,so i am getting response from xero for php 5.3.1 version
but not for php 5.2.11 version.
Is there any specific library that i need to look for in php.
Thanks in advances
T
All methods seem to work fine except $xero->Payments
The screen just goes blank after calling the following method with print_r. I've PHP error values set to show all & it's still blank.
$payment_result = $xero->Payments( $new_payment );
print_r($payment_result);
Any ideas?
Hi,
When attempting to add a payment I get the following error:
PHP Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default in xero.php on line 309
If I change the call to something other than payments this issue doesnt occur
Hi All,
I recently noticed that xero have updated the API, to allow the automated download of approved invoices into PDF format.
I have contacted xero for an actual sample code of this new functionality, the response was poor to say the least.
Does anyone have an example of downloading a PDF invoice through the API?
Thanks very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.