承接 mdhedayet/appsumo-licensing 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mdhedayet/appsumo-licensing

Composer 安装命令:

composer require mdhedayet/appsumo-licensing

包简介

Laravel package to integrate with AppSumo Licensing automatically

README 文档

README

A Laravel package for seamless integration with AppSumo Licensing. This package handles the OAuth flow and webhook events automatically, so you can easily manage license activations, upgrades, downgrades, and deactivations directly from your Laravel application.

Features

  • OAuth Integration: Automatically handles the OAuth callback from AppSumo, exchanges the code for an access token, and retrieves the user’s license data.
  • Webhook Handling: Receives and processes webhook events (purchase, activate, upgrade, downgrade, deactivate) from AppSumo.
  • HMAC Signature Verification: Validates incoming webhook requests to ensure authenticity.
  • Simple Configuration: Easily configure your AppSumo credentials and endpoint URLs using Laravel’s config system.
  • Extensible: Customize business logic in the provided controllers to suit your application's needs.

Requirements

  • PHP >= 7.3
  • Laravel 8.x, 9.x, or 10.x
  • GuzzleHTTP (installed as a dependency)

Installation

Install the package via Composer:

composer require mdhedayet/appsumo-licensing

Configuration

Publish the configuration file to your Laravel application's config directory:

php artisan vendor:publish --tag=config

This command will create a file named config/appsumo.php where you can set your AppSumo credentials and endpoint URLs. For example:

<?php
return [
    // OAuth credentials
    'client_id'     => env('APPSUMO_CLIENT_ID', ''),
    'client_secret' => env('APPSUMO_CLIENT_SECRET', ''),
    'redirect_url'  => env('APPSUMO_REDIRECT_URL', 'https://your-app.com/appsumo/oauth/callback'),

    // Webhook settings
    'webhook_url'   => env('APPSUMO_WEBHOOK_URL', 'https://your-app.com/appsumo/webhook'),
    'webhook_secret'=> env('APPSUMO_WEBHOOK_SECRET', ''),

    // Licensing API key
    'api_key'       => env('APPSUMO_API_KEY', ''),
];

Update your .env file with the corresponding values:

APPSUMO_CLIENT_ID=your-client-id
APPSUMO_CLIENT_SECRET=your-client-secret
APPSUMO_REDIRECT_URL=https://your-app.com/appsumo/oauth/callback
APPSUMO_WEBHOOK_URL=https://your-app.com/appsumo/webhook
APPSUMO_WEBHOOK_SECRET=your-webhook-secret
APPSUMO_API_KEY=your-licensing-api-key

Usage

OAuth Flow

After a user authorizes your application on AppSumo, they will be redirected to your OAuth callback URL:

https://your-app.com/appsumo/oauth/callback

The OAuthController will:

  • Extract the OAuth code from the query parameters.
  • Exchange the code for an access token.
  • Fetch the user's license key using the access token.

You can customize the logic inside OAuthController.php to create or update user accounts based on the license information.

Webhook Endpoint

Set your webhook URL in the AppSumo Partner Portal to:

https://your-app.com/appsumo/webhook

The WebhookController automatically:

  • Validates the incoming webhook request using HMAC SHA256 signature verification.
  • Processes the event data (purchase, activate, upgrade, downgrade, deactivate).
  • Logs or updates your system based on the event type.

Customize the processing logic in WebhookController.php to suit your business requirements.

Facade (Optional)

If you prefer a static interface, you can use the provided facade:

use AppSumo;

$accessToken = AppSumo::getAccessToken($code);
$licenseData = AppSumo::getLicense($accessToken);

Routes

The package automatically registers the following routes (prefixed with appsumo):

  • OAuth Callback: GET /appsumo/oauth/callback
  • Webhook Endpoint: POST /appsumo/webhook

Ensure these routes do not conflict with any existing routes in your application.

Testing

To test your integration:

  1. Set Up in AppSumo:
    • Configure your test product in the AppSumo Partner Portal with the proper OAuth Redirect and Webhook URLs.
  2. Trigger OAuth Flow:
    • Initiate the OAuth process and confirm that your callback correctly processes the code and retrieves the license data.
  3. Simulate Webhook Events:
    • Use the test webhook feature in the AppSumo Partner Portal to simulate events and verify that your application processes them as expected. Check your logs for confirmation messages.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your improvements. For major changes, please open an issue first to discuss what you would like to change.

License

This project is open-sourced software licensed under the MIT license.

mdhedayet/appsumo-licensing 适用场景与选型建议

mdhedayet/appsumo-licensing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 03 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 mdhedayet/appsumo-licensing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 mdhedayet/appsumo-licensing 我们能提供哪些服务?
定制开发 / 二次开发

基于 mdhedayet/appsumo-licensing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-08