2017 © Pedro Peláez
 

library mf-cloud-invoice

MFCloud Invoice API wrapper

image

traimmu/mf-cloud-invoice

MFCloud Invoice API wrapper

  • Monday, April 2, 2018
  • by acro5piano
  • Repository
  • 2 Watchers
  • 5 Stars
  • 2,680 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 17 % Grown

The README.md

Latest Stable Version Latest Unstable Version License Monthly Downloads CircleCI, (*1)

mf_cloud-invoice-php

MFクラウド請求書API client library for PHP, (*2)

This library is inspired by moneyforward/mf_cloud-invoice-ruby, (*3)

Installation

composer require traimmu/mf-cloud-invoice

Usage

Build client

use Traimmu\MfCloud\Invoice\Client;

$client = new Client('YOUR_ACCESS_TOKEN');

$client->billings()->all();
// => your billings

Get My Office

$office = $client->office(); // => returns Traimmu\MfCloud\Invoice\Models\Office instance
echo $office->name; // => '株式会社Traimmu'

$office->update([
    'name' => 'section9',
    'zip' => '101-1111',
]);
echo $office->name; // => 'section9'

Get Partners

$client->partners()->all();
$client->partners()->find('MF INVOICE PARTNER ID');

Get Billings

$client->billings()->all();

Items

$client->items()->all();

Laravel Integration

Add the Traimmu\MfCloud\Invoice\Misc\ServiceProvider provider to the providers array in config/app.php:, (*4)

'providers' => [
    // ...
    Traimmu\MfCloud\Invoice\Misc\ServiceProvider::class,
],

Then add the facade to your aliases array:, (*5)

'aliases' => [
    // ...
    'Invoice' => Traimmu\MfCloud\Invoice\Misc\Facade::class,
],

Finally, add the following lines at config/services.php:, (*6)

// ...
'mfcloud' => [
    'secret' => env('MFCLOUD_INVOICE_API_TOKEN'),
],

Example

Get partners which have more than one departments:, (*7)

<?php
$client->partners()->all()->filter(function ($partner) {
  return count($partner->departments) > 0;
});

Loadmap

  • [ ] Add tests
    • [x] client
    • [ ] api
    • [ ] models
  • [x] Add service provider for Laravel
  • [ ] Add Eloquent model like methods and relationships
    • [x] api->firstOrCreate()
    • [ ] Create Department model
    • [ ] $client->partners()->first()->departments()->create($params)
    • [ ] $client->partners()->first()->departments->first()
    • [ ] Partner hasMany Departments
    • [ ] Department hasMany Billings
    • [ ] Billing hasMany Items
  • [ ] Add Exceptions
  • [ ] Add circle.yml and build automatically
  • [ ] Add more documents
  • [ ] Add authentication for getting OAuth token

Development

After checking out the repo, run composer install to install dependencies., (*8)

Then run vendor/bin/phpunit and ensure all tests success., (*9)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Traimmu/mf_cloud-invoice-php, (*10)

License

The package is available as open source under the terms of the MIT License., (*11)

The Versions

02/04 2018

dev-master

9999999-dev

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by gosho-kazuya

02/04 2018

v0.0.9

0.0.9.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by gosho-kazuya

01/04 2018

v0.0.8

0.0.8.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by gosho-kazuya

31/01 2018

v0.0.7

0.0.7.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by gosho-kazuya

21/10 2017

v0.0.6

0.0.6.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by gosho-kazuya

21/10 2017

v0.0.5

0.0.5.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

by gosho-kazuya

19/10 2017

v0.0.4

0.0.4.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

by gosho-kazuya

18/10 2017

v0.0.3-stable

0.0.3.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

by gosho-kazuya

18/10 2017

v0.0.1

0.0.1.0

MFCloud Invoice API wrapper

  Sources   Download

MIT

The Requires

 

by gosho-kazuya