babaweb/laravel-zohoinvoice

此包已被弃用且不再维护。未建议替代包。

Zoho Invoice API 库

v0.9 2018-07-26 11:59 UTC

This package is not auto-updated.

Last update: 2023-12-24 02:00:36 UTC


README

Laravel 的 Zoho Invoice API 实现

要求

要运行,所有元素都是必需的

安装

运行 Composer require 命令

composer require babaweb/laravel-zohoinvoice

修改 config/app.php 文件以添加 provider

'providers' => [
    ...
    Babaweb\ZohoInvoice\ZohoInvoiceServiceProvider::class
],

最后发布文件

php artisan vendor:publish --provider="Babaweb\ZohoInvoice\ZohoInvoiceServiceProvider"

然后 tadaaa!包已准备好。

配置

要连接到 ZohoInvoice API,需要 tokens。要在 config/zohoinvoice.php 文件中填写它们,需要打开文件

return [
    'authtoken' => env('ZOHO_AUTHTOKEN', 'VOTRE_AUTH_TOKEN'),
    'organization_id' => env('ZOHO_ORGANIZATION', 'VOTRE_ORGANIZATION_ID')
];

使用

添加 facade

use Babaweb\ZohoInvoice\ZohoInvoice;

例如,使用 test 函数

public function test(ZohoInvoice $client) {
    //Vos requêtes ici 
}

函数

可用函数列表

函数详细信息

createItem($parameters)

$parameters = [
    //required
    'name' => 'Product 6.1', //Nom de l'item
    'rate' => '300', //Prix unitaire de l'item
    //Optional
    'description' => 'Test product', //Description de l'item
    'tax_id' => 39448000000026222, //ID de la taxe 
    'product_type' => 'service', //Type de l'item
];

createInvoice($parameters)

$parameters = [
    //required
    'customer_id' => 982000000567001, //ID du client
    //Optional
    'invoice_number' => 'INV-00003', //Numéro de la facture
    'discount' => 0, //Réduction appliquée à la facture. Soit en pourcentage (12.5%) ou un montant (190)
    'is_discount_before_tax' => true, //Vrai si la réduction s'applique au HT
];

createContact($parameters)

$parameters = [
    //required
    'contact_name' => 'Bowman and Co', //Nom du contact
    //Optional
    'company_name' => 'Bowman and Co', //Nom de la société
];

updateItem($item_id, $parameters)

$parameters = [
    //required
    'name' => 'Product 6.1', //Nom de l'item
    'rate' => '300', //Prix unitaire de l'item
    //Optional
    'description' => 'Test product', //Description de l'item
    'tax_id' => 39448000000026222, //ID de la taxe 
    'product_type' => 'service', //Type de l'item
];

许可

此 Laravel 的 ZohoInvoice 包是 MIT 许可的自由软件