mijndomein/dreamcommerce-lms-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mijndomein/dreamcommerce-lms-client

最新稳定版本:7.0

Composer 安装命令:

composer require mijndomein/dreamcommerce-lms-client

包简介

An API client for the Dreamcommerce license manager service

README 文档

README

Build Status

The API library for the DreamCommerce license manager service (LMS) Client

Usage

Before you can use the license functions in the DreamCommerce LMS Client you will need create the LicenseManagerClient. The client will need an ApiConnection with the api url, username, and password.

use DreamCommerce\LicenseManager\ApiConnection;
use GuzzleHttp\Client as HttpClient;

$dreamCommerceClient = new LicenseManagerClient(
    new ApiConnection(
        new HttpClient,
        'http://dc-api-url', 
        'username', 
        'password'
    )
);

Creating a License

To create a DreamCommerce license there is a createLicense method. It will return a License object with the information of the just created license.

use DreamCommerce\LicenseManager\Command\CreateLicenseCommand;

$command = new CreateLicenseCommand;
$command->email = 'user-email@test.com';            // user email address
$command->host = 'test-shop';                       // shop address, e.g. "store001.partnerdomain.com" or "store001" and partnerdomain.com will be added automatically
$command->licenseType = 0;                          // license type (0 - trial, 1 - paid version)
$command->shopVersion = 'x.x.x';                    // shop version, if empty latest version will be used (optional)
$command->package = 'silver';                       // package name
$command->periodInMonths = 12;                      // period in months. So 12 when you're offering a year
$command->notes = 'notes';                          // additional notes (optional)
$command->ssoShopSalt = 'sso-hash-data';            // sso hash (optional)
$command->ssoHandshakeRequesterIp = '127.0.0.1/32'; // sso IP address/mask of handshake system (example: 127.0.0.1/32) or list of IP address/mask pairs delimited by semicolon (example 127.0.0.1/32;192.168.0.0/24) (optional)

$license = $dreamCommerceClient->createLicense($command);

Removing a License

To remove a DreamCommerce license there is a removeLicense method. It will return a boolean with the result of the operation.

$command = new RemoveLicenseCommand;
$command->licenseId = 'license-id';

$isRemoved = $dreamCommerceClient->removeLicense($command);

Suspending a License

To suspend a DreamCommerce license there is a suspendLicense method. It will return a boolean with the result of the operation.

$command = new SuspendLicenseCommand;
$command->licenseId = 'license-id';

$isSuspended = $dreamCommerceClient->suspendLicense($command);

Un-suspending a License

To suspend a DreamCommerce license there is a unsuspendLicense method. It will return a boolean with the result of the operation.

$command = new UnsuspendLicenseCommand;
$command->licenseId = 'license-id';

$isUnsuspended = $dreamCommerceClient->unsuspendLicense($command);

Adding a Domain to a License

To add a domain to a DreamCommerce license there is a addDomainToLicense method. It will return a boolean with the result of the operation.

$command = new AddDomainToLicenseCommand;
$command->licenseId = 'license-id';
$command->licenseDomain = 'domain.com';

$domainAdded = $dreamCommerceClient->addDomainToLicense($command);

Removing a Domain from a License

To remove a domain from a DreamCommerce license there is a removeDomainFromLicense method. It will return a boolean with the result of the operation.

$command = new RemoveDomainFromLicenseCommand;
$command->licenseId = 'license-id';
$command->licenseDomain = 'domain.com';

$domainRemoved = $dreamCommerceClient->removeDomainFromLicense($command);

Ordering a Ssl Certificate for a License

To order a ssl certificate for a DreamCommerce license there is a orderSslCertificateForLicense method. It will return a boolean with the result of the operation.

$command = new OrderCertificateForLicenseCommand;
$command->licenseId = 'license-id';
$command->domainName = 'domain-name.com';
$command->email = 'email@domain-name.com';
$command->company = 'My Company';
$command->firstName = 'First Name';
$command->lastName = 'Last Name';
$command->address = 'Examplestreet 1';
$command->postalCode = '123415';
$command->city = 'City';
$command->state = 'State';
$command->country = 'Country';
$command->phoneNumber = '000000000000';

$certificateOrdered = $dreamCommerceClient->orderSslCertificateForLicense($command);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-04-16