Download the PHP package guilty/poweroffice without Composer
On this page you can find all versions of the php package guilty/poweroffice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download guilty/poweroffice
More information about guilty/poweroffice
Files in guilty/poweroffice
Package poweroffice
Short Description PowerOffice PHP API Client
License MIT
Homepage https://github.com/guilty-as/poweroffice
Informations about the package poweroffice
PowerOffice PHP API Client
Poweroffice API client, used it to talk to the PowerOffice API: https://api.poweroffice.net/Web/docs/index.html
Installation
You can install the package via composer:
Usage
Standalone
You can use the package as a standalone PHP Package, here is a simple example:
Laravel
You can publish the config file like so
This is the contents of the published config file:
To get started, add the following environment variable to your .env file:
Session Implementations
The PowerOffice API uses the "client_credentials" grant type for authentication, to keep track of the "session" (access token, refresh token and expire date) we use a Session class that stores these values for us, out of the box the following session implementations are provided:
Provided Session Implementations
- ArraySession - Used for testing
- ValueStoreSession - Can be used in production, saves all data in a json file defined in the "poweroffice.store_path" config option, uses Spatie's ValueStore package
- RedisSession - Can be used in production, saves all data in a redis cache, keys are prefixed with , expects a Predis Client.
Implementing your own session class
Create a new class that the interface and add the required methods, the actual implementation is up to you, you can put the data in a database, a file, in redis, or whatever you need.
OR...
extend the which implements some of the methods for you.
Here is the interface you need to implement.
Here is an example extending the AbstractSession.
Using the service class
You can use the method directly if you just want to use this package as a thin wrapper for Guzzle that handles the oAuth session storage and maintenance, here is an example:
Or you can use the methods provided, that will prefill the method and path for you, as well as make it easier to provide certain data (like start and end dates).
Note about oData filtering
It seems that PowerOffice's API is case sensitive when it comes to the field names in oData filtering.
TODO
The following services are implemented in the API client wrapper:
Sessions
- [x] ArraySession (testing)
- [x] ValueStoreSession (production)
- [x] RedisSession (production)
Functionality
- [ ] oData filter builder
Services
- [x] Bank/BankTransfer
- [x] Bank/ClientBankAccount
- [x] Blob
- [x] BrandingTheme
- [x] Client
- [ ] ClientAuth
- [x] ContactGroup
- [ ] Customer
- [ ] DebtCollection
- [ ] Department
- [ ] Employee
- [x] ExternallyDeliverableInvoice
- [x] GeneralLedgerAccount
- [ ] Import
- [x] InvoiceAttachment
- [x] JournalEntryVoucher
- [x] Location
- [x] OutgoingInvoice
- [x] PartyBankAccount
- [x] PartyContactPerson
- [x] Payroll/PayItem
- [x] Payroll/SalaryLine
- [x] Product
- [x] ProductGroup
- [ ] Project
- [x] ProjectActivity
- [x] ProjectTeamMember
- [x] RecurringInvoice
- [x] Reporting/AccountTransactions
- [ ] Reporting/CustomerLedger
- [ ] Reporting/InvoiceJournal
- [ ] Reporting/SupplierLedger
- [x] Reporting/TrialBalance
- [x] Reporting/Usage
- [x] SubledgerNumberSeries
- [ ] Supplier
- [x] TimeTracking/Activity
- [x] TimeTracking/HourType
- [x] TimeTracking/TimeTrackingEntry
- [x] VatCode
License
The MIT License (MIT). Please see License File for more information.
Brought to you by Guilty AS
The Poweroffice logo and Trademark is the property of Poweroffice AS
All versions of poweroffice with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^6.3
predis/predis Version ^1.1
spatie/valuestore Version ^1.2