GithubHelp home page GithubHelp logo

freshbooks-php-library's People

Watchers

 avatar

freshbooks-php-library's Issues

Add vat_name and vat_number properties to Client

vat_name and vat_number are missing from the Client class.

Ideally, you should be able to call:

``$client->vatName = 'ABN';''
``$client->vatNumber = '73 152 267 xxx';''

before calling ``$client->create();''

in order to have a VAT number or ABN number show up on a Invoice for taxation 
purposes.

In Australia, this is a legal requirement for a valid Tax Invoice.

Original issue reported on code.google.com by [email protected] on 24 Dec 2013 at 5:43

FreshBooks_ElementAction::update() calls the wrong methods

What steps will reproduce the problem?
1. Use FreshBooks_Invoice::get() to get an existing invoice.
2. Call FreshBooks_Invoice::update() to update the invoice.
3. Examine the value for the $invoiceId field of the invoice.

What is the expected output?
The $invoiceId field of the invoice object should still contain the invoice ID.

What do you see instead?
The invoice ID is empty. This is because in
FreshBooks_ElementAction::update(), _internalPrepareCreate() is called
instead of _internalPrepareUpdate(), and _internalCreate() is called
instead of _internalUpdate() .

What version of the product are you using?
FreshBooks PHP 1.2

Original issue reported on code.google.com by [email protected] on 17 Apr 2010 at 10:55

Library does not support Item folders

A new field was added to all FreshBooks items, called a folder.

There are three types of folders:
Active
Archived
Deleted

These determine what state the item is in, and the library currently does not 
support them at all.

Original issue reported on code.google.com by [email protected] on 14 Apr 2011 at 11:06

Typo in method's name FreshBooks_Recurring::sendMail()

Typo in method's name: I think the FreshBooks_Recurring::sendMail() should be 
FreshBooks_Recurring::sendByMail()

Note: There is already a property named "sendMail" to match the XML parameter 
for the Recurring calls.

Original issue reported on code.google.com by [email protected] on 23 Aug 2010 at 5:59

Special characters not escaped in XML

What steps will reproduce the problem?

Enter special HTML characters (i.e < > & ) into any create/modify/listing and 
it will fail.

What is the expected output? What do you see instead?

For example, creating an item with the name Test& would result in the following 
XML:

<item>
<name>Test&</name>
</item>

When it should be:

<item>
<name>Test&amp;</name>
</item>

Original issue reported on code.google.com by [email protected] on 1 Apr 2011 at 11:25

$invoice->invoiceId returns string(6) rather than string(11)

1. Create a new Invoice.
2. Call $invoice->invoiceId.
3. You get a string such as (var_dump output below):

 string(6) "324319"

The problem with this is that the correct format is:

 string(11) "00000324319"

This is evident if you attempt to call $invoice->get('324319') - it will fail 
because no such invoice exists. Whereas, $invoice->get('00000324319') works.

Original issue reported on code.google.com by [email protected] on 28 Dec 2013 at 10:30

Unable to create payment.

Hi,

    I am trying to create payment using freshbooks api, but its not working. Here is my code:

$payment = new FreshBooks_Payment();
$payment->invoiceId = $invoice->invoiceId;
$payment->clientId = $invoice->clientId;
$payment->amount = $data['amount'];
$payment->type = $data['payment_type'];
$payment->notes = $data['comment'];
$payment->create();

Its not throwing any error also.


If I write echo "yes"; after $payment = new FreshBooks_Payment();. Its not 
printing anything.

Please help me to resolve this issue.

Thanks,
Chandra.


Original issue reported on code.google.com by [email protected] on 3 Jul 2012 at 2:21

Unable to get() and update() Invoices

It seems that the library (as it currently stands) doesn't allow for usage of 
get() to grab Invoice data. As far as I can work out, there is also no way to 
update() invoices.

Example usage:

FreshBooks_HttpClient::init(FRESHBOOKS_URL,FRESHBOOKS_TOKEN);

$invoice = new Freshbooks_Invoice();
$invoice->invoice_id = '00000324300';

if (!$invoice->get('00000324300')) {
    die($invoice->lastError);
}
else {
    print_r($invoice);
}

This returns the error message: 'invoice_id' not found. Invoice not found.

I've also tried supplying the Invoice ID in other formats, e.g: invouce Number 
(0000172) and that doesn't help either.

Original issue reported on code.google.com by [email protected] on 28 Dec 2013 at 3:44

Increase cURL timeout

The current time-out is set to 4 seconds in HttpClient::_init(), but this
timeout can be too short if the FreshBooks site is under heavy load, or if
an auto-bill subscription is being set-up (it looks like FreshBooks
attempts to perform the credit card charge while handling the request).

I recommend increasing the time-out to a more standard 30 seconds, as this
is much less likely to fail.

Original issue reported on code.google.com by [email protected] on 21 Apr 2010 at 12:29

_internalXMLContent() includes read-only fields in XML content

What steps will reproduce the problem?
1. Use FreshBooks_Invoice::get() to get an existing invoice.
2. Call FreshBooks_Invoice::update() to update the invoice.

What is the expected output?
No errors will be returned by the FreshBooks site.

What do you see instead?
The FreshBooks server returns errors about the following fields:
 * amount
 * amount_outstanding
 * links
 * recurringId

This is because _internalXMLContent() in Invoice and BaseInvoice include
fields in the XML payload that are marked read-only in the FreshBooks API.
These fields should be excluded from what is sent to the server.

What version of the product are you using?
FreshBooks PHP 1.2


Original issue reported on code.google.com by [email protected] on 17 Apr 2010 at 11:02

prorate_days

Hi, can you please extend the code to use prorate_days when doing a 
recurring.create?

Thanks :)

Original issue reported on code.google.com by [email protected] on 18 Mar 2015 at 10:53

parser error : xmlParseEntityRef:

What steps will reproduce the problem?
1. Download current version
2. Run example.php


What is the expected output? What do you see instead?
Some sort of client info is what I expect, instead  I get a repeating XML parse 
error:

php example.php
PHP Warning:  simplexml_load_string(): Entity: line 79: parser error : 
xmlParseEntityRef: no name in 
/home/stk/Desktop/freshbooks-api/library/FreshBooks/Element.php on line 74
PHP Stack trace:
PHP   1. {main}() /home/stk/Desktop/freshbooks-api/example.php:0
PHP   2. FreshBooks_ElementAction->get() 
/home/stk/Desktop/freshbooks-api/example.php:16
PHP   3. FreshBooks_Element->_sendRequest() 
/home/stk/Desktop/freshbooks-api/library/FreshBooks/ElementAction.php:62
PHP   4. simplexml_load_string() 
/home/stk/Desktop/freshbooks-api/library/FreshBooks/Element.php:74
PHP Warning:  simplexml_load_string():  if ((version >= 5.5) && (version < 7) 
&& (document.body.filters)) { in 
/home/stk/Desktop/freshbooks-api/library/FreshBooks/Element.php on line 74
PHP Stack trace:
PHP   1. {main}() /home/stk/Desktop/freshbooks-api/example.php:0
PHP   2. FreshBooks_ElementAction->get() 
/home/stk/Desktop/freshbooks-api/example.php:16
PHP   3. FreshBooks_Element->_sendRequest() 
/home/stk/Desktop/freshbooks-api/library/FreshBooks/ElementAction.php:62
PHP   4. simplexml_load_string() 
/home/stk/Desktop/freshbooks-api/library/FreshBooks/Element.php:74




What version of the product are you using? On what operating system?
1.2

Please provide any additional information below.

I feel I am making some sort of basic mistake, but there is nothing out there 
really when googling this, so any help is appreciated.

thank you.


Original issue reported on code.google.com by [email protected] on 17 Mar 2011 at 4:48

SSL Certificate verification is disabled

In the HttpClient.php class, certificate verification is explicitly disabled:

curl_setopt($this->_curlConn, CURLOPT_SSL_VERIFYPEER, FALSE); // Validate SSL 
certificate
curl_setopt($this->_curlConn, CURLOPT_SSL_VERIFYHOST, FALSE);

Which means that you could be talking to an intermediary with a dodgy 
certificate, instead of talking to FreshBooks. The proper verification, an 
attacker would have to compromise a CA that you trust, which is considerably 
harder.

I've attached a trivial patch, to simply remove those two lines. Modern 
versions of the curl library set both of these to the reasonably secure mode by 
default (7.10 onwards).

Original issue reported on code.google.com by [email protected] on 23 Apr 2012 at 3:49

Attachments:

Add language property to Invoice

1. Call invoice->create
2. Pass "language"=>"fr" as a parameter

Invoice is expected to be created in french but it keeps being created in 
english

I think it should be added ton BaseInvoice.php as it is used in Recurring too.

Original issue reported on code.google.com by [email protected] on 10 Jan 2012 at 1:25

_getTagXML() should not use an empty string to designate fields to skip

In FreshBooks_Element, the _getTagXML() method does not generate tags for
elements that have an empty string for a value. This makes it exceedingly
difficult for an application that is using FreshBooks PHP to clear a
previously-populated property of a FreshBooks object.

For example, consider a FreshBooks Client that has an secondary address. If
an application wants to clear it out on the FreshBooks site, the FreshBooks
API docs on developers.freshbooks.com indicate that the application needs
to send the client.update request and specify "s_street1", "s_street2", etc
tags without any values inside. But, if the application is using FreshBooks
PHP, setting $client->sStreet1 and $client->sStreet2 to empty strings will
cause them not to be transmitted.

I recommend switching this behavior over to using NULL as the indicator of
whether a field should be skipped, and using the PHP strict equals operator
(===) in the comparison.

Original issue reported on code.google.com by [email protected] on 27 Apr 2010 at 4:33

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.