定制 anamo/php-market-sdk 二次开发

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

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

anamo/php-market-sdk

Composer 安装命令:

composer require anamo/php-market-sdk

包简介

This repository contains the PHP SDK that allows you to access the Market Platform from your PHP app.

README 文档

README

This repository contains the PHP SDK that allows you to access the Market Platform from your PHP app.

Installation

The Market PHP SDK can be installed with Composer. Include this at the top of your PHP file:


$ composer require-dev anamo/php-market-sdk

Usage

Note: This version of the Market SDK for PHP requires PHP 7.2 or greater.

Simple GET example of a user's profile.

$ws = new \Market\Webstore([
  'app_id' => '{app-id}',
  'app_secret' => '{app-secret}',
  'default_olympian_version' => '2.7',
  //'default_access_token' => '{access-token}', // optional
]);

// Alternatively you can set up the default_access_token at a later time.
//   $ws->setDefaultAccessToken('{access-token}');

try {
  // Get the \Market\OlympianNodes\OlympianNodeWebstore object for the current webstore.
  // If you provided a 'default_access_token', the '{access-token}' is optional.
  $response = $ws->get('/webstores/demo-webstore-id', '{access-token}');
} catch(\Market\Exceptions\MarketResponseException $e) {
  // When Olympian returns an error
  die('Olympian returned an error: ' . $e->getMessage());
} catch(\Market\Exceptions\MarketSDKException | \Exception $e) {
  // When validation fails or other local issues
  die('Market SDK returned an error: ' . $e->getMessage());
}

$webstore = $response->getOlympianNode();
echo 'Browsing in ' . $webstore->getName();

Complete documentation, installation instructions, and examples are available here.

Tests

  1. cURL is a prerequisite for running the tests. Install curl to your terminal.
  2. Issue an Access Token for your Webstore.
#!ssh

curl -G -v -u {app-id}:{app-secret} https://olympian.anamo.one/<olympian_version>/webstores/demo-webstore-id
#!ssh

curl -G -v -u {access-token} https://olympian.anamo.one/<olympian_version>/webstores/demo-webstore-id
Enter host password for user '{access-token}'
<enter>

Contributing

For us to accept contributions you will have to first have signed the Contributor License Agreement. Please see CONTRIBUTING for details.

License

Please see the license file for more information.

Security Vulnerabilities

If you have found a security issue, please contact the maintainers directly at feedback@anamo.company.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固