2017 © Pedro Peláez
 

library taobao-top-client

Taobao top client(SDK) for laravel

image

orzcc/taobao-top-client

Taobao top client(SDK) for laravel

  • Friday, July 6, 2018
  • by orzcc
  • Repository
  • 2 Watchers
  • 53 Stars
  • 5,161 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 35 Forks
  • 0 Open issues
  • 2 Versions
  • 17 % Grown

The README.md

Taobao Affiliate API for Laravel/Lumen

The Taobao Affiliate API has been upgraded to version 2.0, merging the "Taobao Affiliate Basic Package" into the "Taobao Affiliate Basic API"., (*1)

Laravel Integration

Installation

Install the package via Composer:, (*2)

composer require orzcc/taobao-top-client

Configuration

  1. Add the service provider to the providers array in config/app.php:
Orzcc\TopClient\TopClientServiceProvider::class,
  1. Add the facade to the aliases array in config/app.php:
'TopClient' => Orzcc\TopClient\Facades\TopClient::class,
  1. Publish the configuration file:
php artisan vendor:publish --provider="Orzcc\TopClient\TopClientServiceProvider"
  1. Set your appid and appsecret in the .env file:
TAOBAO_APP_KEY=your_app_key
TAOBAO_APP_SECRET=your_app_secret

Usage Example

use TopClient;
use TopClient\request\TbkItemGetRequest;

$topclient = TopClient::connection();
$req = new TbkItemGetRequest;
$req->setFields("num_iid,title,pict_url,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setQ('phone');
$req->setSort("tk_total_sales");
$req->setPageNo('1');  // Note: Use string values for correct pagination
$req->setPageSize('40');
$resp = $topclient->execute($req);
dd($resp);

Lumen Integration

Installation

Install the package via Composer:, (*3)

composer require orzcc/taobao-top-client

Configuration

  1. Manually copy the configuration file:
cp vendor/orzcc/taobao-top-client/config/taobaotop.php config/taobaotop.php
  1. Add the following to bootstrap/app.php:
if (!class_exists('TopClient')) {
    class_alias('Orzcc\TopClient\Facades\TopClient', 'TopClient');
}
$app->register(Orzcc\TopClient\TopClientServiceProvider::class);
  1. Set your appid and appsecret in the .env file:
TAOBAO_APP_KEY=your_app_key
TAOBAO_APP_SECRET=your_app_secret

Usage Example

The usage example for Lumen is the same as for Laravel:, (*4)

use TopClient;
use TopClient\request\TbkItemGetRequest;

$topclient = TopClient::connection();
$req = new TbkItemGetRequest;
$req->setFields("num_iid,title,pict_url,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setQ('phone');
$req->setSort("tk_total_sales");
$req->setPageNo('1');  // Note: Use string values for correct pagination
$req->setPageSize('40');
$resp = $topclient->execute($req);
dd($resp);

This project is sponsored by SoPicks, a revolutionary fashion discovery platform that aggregates products from multiple online stores, offering a seamless way to find and purchase desired brands all in one place., (*5)

License

This package is open-sourced software licensed under the MIT license., (*6)

The Versions

06/07 2018

dev-master

9999999-dev https://github.com/orzcc/taobao-top-client

Taobao top client(SDK) for laravel

  Sources   Download

MIT

The Requires

 

by Avatar orzcc

laravel api sdk taobao

05/06 2018

dev-develop

dev-develop https://github.com/orzcc/taobao-top-client

Taobao top client(SDK) for laravel

  Sources   Download

MIT

The Requires

 

by Avatar orzcc

laravel api sdk taobao