Download the PHP package siegerhansma/acumulus-php without Composer
On this page you can find all versions of the php package siegerhansma/acumulus-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package acumulus-php
Unofficial Acumulus PHP SDK
Official Acumulus documentation: https://apidoc.sielsystems.nl/
This package uses Guzzle to make the cUrl requests to Acumulus. Because of its dependency to Guzzle, this package requires PHP >= 5.4 to function.
Installation
Via composer
Add the package to your composer.json file
Configuration
All of the provider classes take a config array as parameter.
You could put these variables in a specific config file.
Usage
Every class and function is fully documented in the online documentation.
Request
The calls in the API can be called via specific classes corresponding to the categories on the official API docs. To start, create a new instance of the provider class you need.
After that, all the calls in that class will be available via the $client variable.
When the method is called, you can chain the sendRequest method to that. This method actually sends the request to the Acumulus API. The same principle stands for the other provider classes.
Response
The sendRequest method returns the response given by Acumulus. The response is being cast to an array for multiple records or an instance of the model for a single record.
In the example below is the response of the getAvailableContacts method on the ContactsProvider.
Example response
Models
For the responses you get from Acumulus, there are several models being used. There models are integral copies of the responses and have their own getters and setters. For a list of all the models and the methods that you can use on them, check out the API documentation here
Adding an invoice
By far the most difficult task this package does is adding an invoice to Acumulus. I've tried to create this as easy as possible, but the call being made is pretty complex. One thing to note is that Acumulus looks at the customer emailadress as being the unique identifier of a customer. So if a customer doesn't have an email yet, this package will automatically create a unique emailaddress for that customer to prevent creating multiple customers. However, before you make this call it's recommended that you make sure that the customer has an email. To (hopefully) make this a little bit easier for you, I made an InvoiceBuilder class. Here's an example of how to use this.
In the response from Acumulus you will get an array with the following fields:
- invoicenumber
- token
- entryid
LICENSE
Copyright (c) 2014 Sieger Hansma
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
TODO
A lot still to do, here's what:
- Write more tests
- Make documentation
- Support Picklists
If you have any questions, feedback or if you encounter a bug, please leave an issue or a pull request.