Giter Club home page Giter Club logo

freeagent-php's Introduction

freeagent-php

Build Status

This is a PHP library that provides a comprehensive wrapper for the Freeagent v2 API.

Installation

You can install this library via Composer:

composer require 6by6/freeagent-php

Compatibility

We are currently testing against the following PHP versions:

  • '5.6'
  • '7.0'
  • hhvm
  • nightly

Unit Tests

Phpunit tests are provided with the library, however, we would strongly recommend NOT executing these against your live account. The tests require a clean account and part of the process involves deleting any data before starting i.e. everything about your business.

The test suite will attempt to ensure you are not using a live account before executing tests, however, we will not be held responsible for any loss of data.

If you're just getting started we would recommend using a sandbox account (obtainable via the Freeagent API Quickstart Guide).

Getting Started

Get a list of invoices

use SixBySix\Freeagent\OAuth\Api;
use SixBySix\Freeagent\Entity\EntityCollection;
use SixBySix\Freeagent\Entity\Invoice;

/** @var Api $api */
$api = new Api(
  $clientId = getenv('API_CLIENT_ID'),
  $clientSecret = getenv('API_CLIENT_SECRET'),
  $refreshToken = getenv('API_REFRESH_TOKEN'),
  $sandbox = true
);

/** @var EntityCollection $invoiceCollection */
$invoiceCollection = $api->invoice()->query([
  'view' => 'last_3_months',
]);

/** @var Invoice $invoice */
foreach ($invoiceCollection as $invoice) {
  echo "{$invoice->getReference()}\n";
}

Bug Reports

Please use the Github Issue Tracker for support.

freeagent-php's People

Contributors

daniel-ness avatar

Watchers

 avatar  avatar

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.