Code Monkey home page Code Monkey logo

easytbk's Introduction

介绍

淘宝联盟、京东联盟、多多进宝、唯享客、苏宁推客SDK封装,该项目长期维护,如发现问题,请提交PR。

仅支持laravel5-laravel8,这不是可以直接拿来用的返利系统。

不要加我微信问我什么是SDK,如果你不懂,说明这个扩展不适合你。

联系方式

微信:flutter_best

安装

1、安装扩展包,该扩展包只支持laravel

composer require niugengyun/easytbk

2、执行下面的命令,然后修改config/easytbk.php

php artisan vendor:publish --provider "NiuGengYun\EasyTBK\ServiceProvider"

初始化SDK

每个平台SDK的具体调用方法参考各平台的文档

1、淘宝SDK初始化

<?php
use NiuGengYun\EasyTBK\Factory;
use NiuGengYun\EasyTBK\taobao\request\TbkItemInfoGetRequest;

$client = Factory::taobao ();
$req = new TbkItemInfoGetRequest();
$req->setNumIids ($numIids);
return $client->execute ($req);

2、京东SDK初始化

<?php
use NiuGengYun\EasyTBK\Factory;
use NiuGengYun\EasyTBK\jingdong\request\JdUnionGoodsPromotiongoodsinfoQueryRequest;

$jd = Factory::jingdong();
$req = new JdUnionGoodsPromotiongoodsinfoQueryRequest();
$req->setSkuIds("$itemid");
return $jd->execute($req);

3、拼多多SDK初始化

<?php
use NiuGengYun\EasyTBK\Factory;
use NiuGengYun\EasyTBK\pinduoduo\request\DdkGoodsDetailRequest;

$pdd = Factory::pinduoduo();
$req = new DdkGoodsDetailRequest();
$req->setGoodsIdList("[$itemid]");
return  $pdd->execute($req);

4、唯品会SDK初始化

<?php
use NiuGengYun\EasyTBK\Factory;
use NiuGengYun\EasyTBK\Vip\Request\PidGenRequest;
use NiuGengYun\EasyTBK\Vip\Request\UnionPidServiceClient;

// 唯品会官方的sdk写的比较垃圾,用法和其他平台稍微不一样
$service= UnionPidServiceClient::getService();
Factory::vip();
$pidGenRequest1 = new PidGenRequest();
$pidNameList2 = array();
$pidNameList2[0] = "value";
$pidGenRequest1->pidNameList = $pidNameList2;
$pidGenRequest1->requestId = "requestId";
dd($service->genPidWithOauth($pidGenRequest1));

5、苏宁连联盟SDK初始化

<?php
use NiuGengYun\EasyTBK\Factory;
use NiuGengYun\EasyTBK\suning\Request\netalliance\CouponproductQueryRequest;

$c = Factory::suning();
$req = new CouponproductQueryRequest();
$req->setPageNo("1");
$req->setPageSize("10");
$req->setPositionId("12");
$resp = $c->execute($req);
dd($resp);

easytbk's People

Contributors

flutterbest avatar cranux avatar maxzhang666 avatar oneyzh avatar wangzijie01 avatar gakkiismywife avatar srayaa avatar crazyfd avatar wechat-apis avatar wenbobao avatar calchen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.