承接 zamnuts/ean-api-client 相关项目开发

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

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

zamnuts/ean-api-client

Composer 安装命令:

composer require zamnuts/ean-api-client

包简介

Expedia Affiliate Network API Client

README 文档

README

This is a comprehensive library for working with v3 r27 of the EAN API. An affiliate account is required to actually use any of this successfully (even in developer mode). Read more about it in the EAN Developer Documentation. This structured library attempts to provide precise request and response parameters for each query type. This is especially helpful when code-hinting is available via an IDE of some sort; it should speed up integration and leave out guess-work during maintenance.

Current State of This Lib

Not going to lie here... it is in need of a good inventory and audit. At the time of this writing, this has been sitting on the shelf collecting dust for a while now.

  • It was at one point successfully functioning in a production environment.
  • The phpdocs are mostly complete for public members.
  • Most, but not all, request/response types are accounted for; one that I know of that is incomplete is LocationInfoRequest within Geo Functions (just b/c the project this was intended for didn't use it), but the rest should be functional.
  • No unit tests exist whatsoever, oops. Written tests with stubs and fixtures would be nice, yes?
  • Some of the "behind-the-scenes" methods are half baked; the original intention was for two-way request/response processing and rendering. This never came to fruition, but there are remnants, and some of them work.
  • Only supports r27 of the API, while the latest at the time of this writing is v30.

Usage and Examples

See examples/*.php for hotel list search example and general usage.

To get started, you'll need an EAN API key and secret. Only one EANConfig and EANFacade is required at a time. EANConfig is used as a model to feed the API configuration into EANFacade. EANFacade applies the general configurations to each query request, e.g. EANFacade->query(EANAbstractQuery). Anything in EANAPIClient\Query can be instantiated and passed into the facade's query method, at which point the response property of the EANAbstractQuery object will contain the results. Any instance of EANAbstractQuery is stateful, so if repeat and/or subsequent queries must be performed (especially of the same type), a new one should be instantiated, and then passed into the same EANFacade instance's query method.

Ping Example

use zamnuts\EANAPIClient\EANFacade;
use zamnuts\EANAPIClient\EANConfig;
use zamnuts\EANAPIClient\Query\EANPing;

// need session ID for EAN API, this can technically be anything, but this is best practice
session_start();

// config for EANFacade
$config = new EANConfig();
$config->apiKey		= ''; // CHANGEME
$config->apiSecret	= ''; // CHANGEME
$config->cid		= 0; // CHANGEME
$config->sessionId	= session_id(); // this happens automatically, but just for example
$config->devMode	= true; // switch to "false" in prod

// this is the gateway into the EAN API, all query structures are executed through this profile
$ean = new EANFacade($config); // just need one of these for all queries to use

$ping = new EANPing();
$ping->echo = 'Hello World'; // send this data
$ean->query($ping);

// due to the nature of the EAN API's ping request,
// the "echo" parameter should be the same in the response as the request
echo $ping->response->echo."\n"; // got this data back

echo ($ping->response->echo === $ping->echo ? 'MATCH' : 'INVALID')."\n";

Will output:

Hello World
MATCH

License

BSD-3-Clause, see LICENSE file for full text. (c) 2015 Andrew Zammit zammit.andrew@gmail.com

zamnuts/ean-api-client 适用场景与选型建议

zamnuts/ean-api-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 131 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 10 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「client」 「ean」 「expedia」 「hotel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 zamnuts/ean-api-client 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-10-15