mhshujon/license-manager

一个旨在无缝处理WooCommerce(WC)和Easy Digital Downloads(EDD)许可API的许可管理库。此库仅适用于WordPress环境。

v1.0.1 2024-04-16 10:55 UTC

This package is auto-updated.

Last update: 2024-09-16 11:54:53 UTC


README

使用以下命令通过Composer安装SDK

包URL: https://packagist.org.cn/packages/mhshujon/license-manager

composer require mhshujon/license-manager

如何使用?

Easy Digital Downloads (EDD)

验证您的许可证

$license_manager = new \mhshujon\LicenseManager\EDD\EDDLicenseManager(
    'action', // Check https://easydigitaldownloads.com/docs/software-licensing-api/ for action list
    'item-id', // Check https://easydigitaldownloads.com/docs/software-licensing-api/
    'license-key',
    'product-title',
    'license-server-host-url'
);
$license_manager->validate_license();
$response = $license_manager->get_response();

Easy Digital Downloads (EDD)

获取插件更新

// retrieve our license key from the DB
$license_key = trim( get_option( 'edd_sample_license_key' ) ); 

// setup the updater
$edd_updater = new \mhshujon\LicenseManager\EDD\PluginUpdater(
    'version' 	=> '1.0',   // current plugin version number
    'license' 	=> $license_key,    // license key (used get_option above to retrieve from DB)
    'item_id'   => EDD_SAMPLE_ITEM_ID,  // id of this plugin
    'author' 	=> 'Author Name',   // author of this plugin
    'beta'      => false    // set to true if you wish customers to receive update notifications of beta releases
);