divdax/ easybill
Laravel 包,用于使用 easybill.de REST API
1.0.10
2022-09-05 11:04 UTC
Requires
- guzzlehttp/guzzle: ^6.2|^7.0
- illuminate/support: ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0|^9.0
README
非官方 Laravel 包,用于使用 easybill.de REST API。
这个 Laravel 包是一个非常基础且未测试的版本!
安装
composer require divdax/easybill
Laravel 5.5+
无需注册任何提供者/别名。感谢 Laravels 包发现。
Laravel 5.4
在 config/app.php
中添加 ServiceProvider 和 Facade
'providers' => [ ... DivDax\Easybill\EasybillServiceProvider::class, ]; 'aliases' => [ ... 'Easybill' => DivDax\Easybill\Facade\Easybill::class, ];
配置
将 easybill.de API 密钥添加到您的 .env
EASYBILL_API_KEY=xxxxxx
使用方法
我只实现了某些基本 API 调用
// Search Customer with exact match Easybill::searchCustomer([ 'company_name' => 'Company Name' ]); // Create Customer $customer = Easybill::createCustomer([ 'company_name' => 'Musterfirma GmbH', 'first_name' => 'Max', 'last_name' => 'Muster', 'street' => 'Musterstr. 123', 'zipcode' => '12345', 'city' => 'Musterstadt', 'emails' => ['mail@example.com'], ]); // Delete Customer Easybill::deleteCustomer($customer->id); // Create Document (Invoice) $doc = Easybill::createDocument([ 'type' => 'INVOICE', 'title' => 'Titel', //'customer_id' => 0, 'text_prefix' => 'Hello', 'text' => 'Bye', 'items' => [ [ 'type' => 'POSITION', 'number' => '123', // article number 'description' => 'Positionsbeschreibung 1', 'quantity' => 1, 'single_price_net' => 10 * 100, // cent 'vat_percent' => 19 ], [ 'type' => 'TEXT', 'description' => 'Text only', ], [ 'type' => 'POSITION', 'description' => 'Positionsbeschreibung 3', 'quantity' => 1, 'single_price_net' => 20 * 100, 'vat_percent' => 19 ], ], ]); // Finish Document (set auto created document number) $doc->done(); // Update Document Easybill::updateDocument($id, ['status' => 'DONE']);
贡献
如果您发现了一个问题,或者有更好的方法来做某事,请随时打开一个问题或拉取请求。