承接 mozu/api 相关项目开发

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

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

mozu/api

Composer 安装命令:

composer require mozu/api

包简介

SDK for Mozu Rest APIs

README 文档

README

PHP SDK for the full v1 Mozu Api

PackageGist: https://packagist.org/packages/mozu/api

Usage:

Authenticating an Application with server provided refresh interval tokens

$appAuthInfo = new AppAuthInfo();<br>
$appAuthInfo->sharedSecret = [sharedSecret];
$appAuthInfo->applicationId = [applicationId];
AppAuthenticator::initialize($appAuthInfo,null);

###Get Tenant Information using Async operation

$tenantResource = new TenantResource();
$promise = $tenantResource->getTenantAsync([tenantId]);
$tenant = $promise->wait()->json();

###Get Products

$apiContext = new ApiContext($tenant);
#You might need to create an API Context with a specific Mastercatalog or catalogId if you own a multi-catalog tenant<br>
$productResource = new ProductResource($apiContext, DataViewMode::LIVE);
$promise = $productResource->getProductsAsync(0, 200, null, null, null, null, null);
$promise->then(function($mozuResult) {
    printf($mozuResult->json()->pageCount);
    printf($mozuResult->json()->items);
    
    printf($mozuResult->correlationId);
}, function($apiException) {
    printf("Exception : code - " . $apiException->getCode() . ", message - " . $apiException->getMessage(). ", correlationid - " . $apiException->getCorrelationId() );
});

###Get Orders - Filter by date

$orderResource = new OrderResource($apiContext);
$filters = urlencode("submittedDate gt 2013-12-15T12:21:24z");
$promise = $orderResource->getOrdersAsync('0',100, null,$filters, null, null);
$mozuResult = $promise->wait();
$correlation = $mozuResult->correlationId;
$orders = $mozuResult->json()->items;

###Get Products - Pool multiple requests

$productResource = new ProductResource($apiContext, DataViewMode::LIVE);
$promises = [
    "product1" => $this->object->getProductAsync("product1"),<br>
    "product2" => $this->object->getProductAsync("product2"),<br>
    "product3" => $this->object->getProductAsync("product3")<br>
];
$results = Promise\unwrap($promises);
printf($results["product1"]->json()->productCode);
printf($results["product2"]->json()->productCode);
printf($results["product3"]->json()->productCode);

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 39
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2014-04-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固