Download the PHP package isinlor/freshbooks-php without Composer

On this page you can find all versions of the php package isinlor/freshbooks-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package freshbooks-php

freshbooks-php

Freshbooks PHP Library (forked from: https://code.google.com/p/freshbooks-php-library/)

Credit to Milan Rukavina ([email protected]) for developing the original library at the above URL.

Warning

Please note that the library from which this is forked has not been updated or maintained since May 2011. It has A LOT of bugs. It works for some basic tasks well (sending invoices, triggering payments via a payment gateway) but there are lot of "basic" functions that are broken (grabbing invoice details by invoice #, updating invoices as sent, etc.)

This library is only for the brave of heart and for those interested in helping fix up an outdated Freshbooks PHP library.

Initiation

To initialize the library, include an initiation block like below.

// Include particular file(s) for entity you need (Client, Invoice, Category…)
include_once "library/FreshBooks/Client.php";

// Your API url and token obtained from Freshbooks.com
$url = "your-url-please-replace";
$token = "your-token-please-replace";

// Cnit singleton FreshBooks_HttpClient
FreshBooks_HttpClient::init($url,$token);

Get Client Data

// New Client object
$client = new FreshBooks_Client();

// Try to get client with client_id 3
if (!$client->get(3)){
    // No data – read error
    echo $client->lastError;
}
else {
    // Investigate populated data
    print_r($client);
}

New Client

// new Client object
$client = new FreshBooks_Client();

//populate client’s properties
$client->email = ‘[email protected]’;
$client->firstName = ‘Chad’;
$client->lastName = ‘Smith’;

//all other required properties should be populated

//try to create new client with provided data on FB server
if(!$client->create()){
    //read error
    echo $client->lastError;
}
else {
    //investigate populated data
    print_r($client);
}

Lookup Invoice By InvoiceID #00000324301

$invoice = new Freshbooks_Invoice();

$invoice->get('00000324301')
    or die("Unable to get Invoice: " . $invoice->lastError);

print_r($invoice);

Lookup Invoice(s) for Client #17992

$invoice = new Freshbooks_Invoice();

$invoice->listing($rows, $resultInfo, 1, 3, array('clientId' => 17992,
                                              'status' => '',
                                              'dateTo' => '',
                                              'dateFrom' => '',
                                              'recurringId' => ''))
    or die("Unable to grab Invoice listing: " . $invoice->lastError);

if ($invoice) {
    print_r($rows);
    print_r($resultInfo);
}

Mark Invoice As Paid

$payment = new Freshbooks_Payment();

$payment->invoiceId = '00000324300';

// To mark payment as 'PAID', this amount must be the full amount outstanding on the invoice
$payment->amount    = '2.44';

$payment->type      = 'Bank Transfer';

$payment->create()
    or die("Unable to mark Invoice as paid: " . $payment->lastError);

// Note: this will automatically send the client a payment notification e-mail
// letting them know that their invoice has been paid.

All versions of freshbooks-php with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package isinlor/freshbooks-php contains the following files

Loading the files please wait ....