定制 mahan-shoghy/laravel-quickbooks 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mahan-shoghy/laravel-quickbooks

最新稳定版本:1.23

Composer 安装命令:

composer require mahan-shoghy/laravel-quickbooks

包简介

Laravel QuickBooks API Implementation

README 文档

README

Laravel Quickbooks API Package simplifies integration with the Quickbooks API in Laravel applications.

For now, only OAuth2, Item and Webhook functionality is released.

Feel free to add more features!

Quickbooks API Documentation

Table of Contents

Installation

Via composer (Laravel 10+):

composer require mahan-shoghy/laravel-quickbooks

Optional: If you want to publish the config file, use the following command:

php artisan vendor:publish --provider="MahanShoghy\LaravelQuickBooks\QuickBooksServiceProvider" --tag="config"

Usage

Setup environment

Add and set these variables to your environment file:

QUICKBOOKS_CLIENT_ID=
QUICKBOOKS_CLIENT_SECRET=
QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN=

You can create credentials and get values from the Quickbooks App Dashboard

API

Explore the various API endpoints provided by the Quickbooks API, organized into the following categories:

Each section provides detailed instructions on how to interact with the Quickbooks API for different aspects of your business.

Webhook

Webhooks allow your Laravel application to receive and handle Quickbooks events in real-time. Follow these steps to set up webhook handling in your application.

  1. Define a Webhook Route: In your Laravel routes file (like: web.php), add a route for handling webhooks. You can choose any URL you prefer:
     Route::quickbooksWebhooks('your-webhook-url');
    
  2. Add Verifier Token: After adding the webhook URL in the Quickbooks Dashboard, it will provide you with a verifier token. Copy and use this token as the value for QUICKBOOKS_WEBHOOK_VERIFIER_TOKEN in your environment file.
  3. Configure Webhook Events: Open the quickbooks.php configuration file (which you published in Installation) and specify the events you want to handle and the corresponding job classes.

    In the jobs array, define your webhook event handlers using the format {NAME}_{OPERATION}, where:

    • {NAME}: Represents the entity or object type associated with the event.
    • {OPERATION}: Indicates the specific action or operation being performed on the entity.

    For example:

     'jobs' => [
         'ITEM_CREATE'     => ItemCreatedJob::class,
         'CUSTOMER_UPDATE' => CustomerUpdatedJob::class,
         'INVOICE_DELETE'  => InvoiceDeletedJob::class,
     ]
    

    In the job class, you can access the entity data sent by Quickbooks to handle the event.

     class ItemCreatedJob implements ShouldQueue
     {
         public array $realmId;
         public array $entity;
        
         public function __construct(string $realmId, array $entity)
         {
             $this->realmId = $realmId;
             $this->entity = $entity;
         }
        
         public function handle(): void
         {
             // Handle the webhook event using $this->entity
         }
     }
    
  4. Event Documentation: You can find a list of available Quickbooks webhook events in the Quickbooks documentation. This resource will help you understand and configure the events you wish to handle.

  5. Use Laravel Queues: For better performance and scalability, consider using Laravel queues to handle webhook jobs asynchronously. This ensures that your application remains responsive even during heavy webhook traffic.

Now, your Laravel application is ready to receive and process Quickbooks webhook events in real-time.

Support

If you have any questions or need assistance, feel free to contact us. if there are specific code examples you'd like to include in the README to help users get started quickly, you can add those as well.

Donate

If you find this package helpful and would like to support its development, you can make a donation in cryptocurrency. Your contributions will help maintain and improve this package.

You can send your contribution to the following address in your MetaMask wallet:
Wallet Address:

0x4B3d57AC72B57a76b778Bac4e3b32d2d4d729955

Thank you for your support!

统计信息

  • 总下载量: 36
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-08