定制 sebastianpozoga/php-allegroapi 二次开发

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

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

sebastianpozoga/php-allegroapi

Composer 安装命令:

composer require sebastianpozoga/php-allegroapi

包简介

A newest library to communicate with Allegro Api. The library is OOP, good tested and easy to use. Make your job enjoyable. The version is tested with PHP5.5

README 文档

README

A newest library to communicate with Allegro Api. The library is OOP, good tested and easy to use. Make your job enjoyable. The version is tested with PHP5.5

Documentation

In this section I describe a class and methods you should use

Configuration

To run test you must insert you login, password and appkey to Config/config.ini file.

login = "Insert your login here"
password = "Insert your password here - never do it in production"
apikey = "Insert your apikey here"
sandbox = false
countryCode = 1

The file is use only by tests.

You can create your access data by http://allegro.pl/myaccount/webapi.php/ page. sandbox is use to switch allegro sandbox and production version. countryCode is used to select current country. Default 1 mean Poland. If you want you can change country to communication with other allegroGroup services like: aukro.cz, molotok.ru, aukro.ua, teszvesz.hu

Security

Never storage your plain password. Your app should always hash it by sha256 (used by allegro)

  $hashPassword = base64_encode(hash('sha256', YOUR_ALLEGRO_PASSWORD, true));

Class AllegroApi

AllegroApi is main class. Provide api access interface.

Constructor

Require one object with login, hashPassword (or password - strongly no recomended), apikey, sandbox, countryCode fields. The data is use to init connections.

LoginEnc

Login to allegro (use constructor data)

Run functions

The api use _call to maping functions names to allegro request. You should use short names without "do". Use getCountries (to rum allegro doGetCountries function).

  $allegroApi = new AllegroApi($config);
  $countrisResponse = $allegroApi->getCountries();

#Allegro functions documentation Description of all allegro functions are available on http://allegro.pl/webapi/documentation.php

Quick start

Clone empty project:

git clone https://github.com/SebastianPozoga/PHP-AllegroApi-EmptyProject.git
composer install

And run:

php index.php

Tests

Run tests by:

phpunit tests/AllegroApiTest

Older version

It is strong recomended to use new version of PHP Allegro Api Library. If you must use old version is available on https://github.com/SebastianPozoga/Allegro-PHP-API-14

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固