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

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

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

mahan-shoghy/laravel-squareup

最新稳定版本:1.0.1

Composer 安装命令:

composer require mahan-shoghy/laravel-squareup

包简介

Squareup implementation for Laravel

README 文档

README

Laravel Squareup API Package enables secure payment processing and easy integration with Square's suite of business solutions. Simplify order management, inventory synchronization, and customer record-keeping, ensuring seamless interaction with Square sellers' systems. Easily build dynamic business applications with Square's RESTful API design.

Table of Contents

Installation

Via composer (Laravel 10+):

composer require mahan-shoghy/laravel-squareup

Publish the config file, use the following command:

php artisan vendor:publish --provider="MahanShoghy\LaravelSquareup\SquareupServiceProvider" --tag="config"

Usage

Setup .env file

Add and set these variables to your environment file:

SQUAREUP_APPLICATION_ID=
SQUAREUP_APPLICATION_SECRET=
SQUAREUP_ACCESS_TOKEN=

You can obtain these values from the Squareup App Setting.

If you wish to use the sandbox, set SQUAREUP_HOST to https://connect.squareupsandbox.com in your environment file.

API

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

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

Webhook

Webhooks allow your Laravel application to receive and handle Squareup 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::squareupWebhooks('your-webhook-url');
    
  2. Configure Webhook Events: Open the squareup.php configuration file (which you published in Installation) and specify the events you want to handle and the corresponding job classes. Here's an example:

     'jobs' => [
         'bank_account_created' => BankAccountCreatedJob::class
     ]
    

    In the job class, you can access the payload data sent by Squareup to handle the event.

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

  4. 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 Squareup 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!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-31