-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
470 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false | ||
|
||
[*.{vue,js,scss}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* text=auto | ||
|
||
/tests export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.scrutinizer.yml export-ignore | ||
.travis.yml export-ignore | ||
phpunit.php export-ignore | ||
phpunit.xml.dist export-ignore | ||
phpunit.xml export-ignore | ||
.php_cs export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.idea | ||
*.DS_Store | ||
/vendor | ||
/coverage | ||
sftp-config.json | ||
composer.lock | ||
.subsplit | ||
.php_cs.cache | ||
index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
$header = <<<EOF | ||
This file is part of the onecoder/easytaoke. | ||
(c) LaJun <[email protected]> | ||
This source file is subject to the MIT license that is bundled. | ||
EOF; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules(array( | ||
'@Symfony' => true, | ||
'header_comment' => array('header' => $header), | ||
'array_syntax' => array('syntax' => 'short'), | ||
'ordered_imports' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'php_unit_construct' => true, | ||
'php_unit_strict' => true, | ||
)) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->exclude('vendor') | ||
->in(__DIR__) | ||
) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,40 @@ | ||
# TaoKeSdk | ||
简单易用的多平台淘客SDK,灵活性强,扩展性。 | ||
<h1 align="center"> EasyTaoKe </h1> | ||
|
||
<p align="center"> 致力于最简单易用,最全的PHP淘客SDK.</p> | ||
|
||
|
||
## Composer安装 | ||
|
||
```shell | ||
$ composer require onecoder/easytaoke -vvv | ||
``` | ||
|
||
## 用法 | ||
|
||
```php | ||
|
||
$config = [ | ||
'key' => '', //美团联盟key | ||
'secret' => '', //美团联盟secret | ||
'callback_secret' => '', //美团联盟callback_secret | ||
]; | ||
|
||
//实例化美团联盟应用 | ||
$meiTuanUnion = \OneCoder\EasyTaoKe\Factory::meiTuanUnion($config); | ||
$startTime = time() - 24 * 60 * 60; | ||
$endTime = time(); | ||
|
||
//获取美团联盟订单 | ||
$data = $meiTuanUnion->getOrderList($startTime, $endTime); | ||
|
||
//回调验证,返回true验证通过 | ||
$callBackResult = $meiTuanUnion->validateCallback($params); | ||
``` | ||
|
||
## 贡献 | ||
|
||
欢迎广大PHPer一起加入淘客CPS SDK开发,致力于最完善易用的开源 SDK, 一起来PR | ||
|
||
## 开源协议 | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "onecoder\/easytaoke", | ||
"description": "最简单易用,最全的PHP淘客SDK", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "LaJun", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"guzzlehttp/guzzle": "^7.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"OneCoder\\EasyTaoKe\\": "src" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<testsuites> | ||
<testsuite name="Application Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* 2021年01月02日 23:32 | ||
*/ | ||
|
||
namespace OneCoder\EasyTaoKe\Base; | ||
|
||
/*** | ||
* | ||
* 基础应用类 | ||
* Class Application | ||
* | ||
* @package OneCoder\EasyTaoKe\Base | ||
*/ | ||
class Application | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* 2021年01月02日 14:33 | ||
*/ | ||
|
||
/* | ||
* This file is part of the onecoder/easytaoke. | ||
* | ||
* (c) LaJun <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace OneCoder\EasyTaoKe; | ||
|
||
/** | ||
* Class Factory. | ||
*/ | ||
class Factory | ||
{ | ||
/** | ||
* @param string $name | ||
* @param array $config | ||
* | ||
* @return \EasyWeChat\Kernel\ServiceContainer | ||
*/ | ||
public static function make($name, array $config) | ||
{ | ||
$namespace = ucwords($name); | ||
$application = "\\OneCoder\\EasyTaoKe\\{$namespace}\\Application"; | ||
|
||
return new $application($config); | ||
} | ||
|
||
/** | ||
* Dynamically pass methods to the application. | ||
* | ||
* @param string $name | ||
* @param array $arguments | ||
* | ||
* @return mixed | ||
*/ | ||
public static function __callStatic($name, $arguments) | ||
{ | ||
return self::make($name, ...$arguments); | ||
} | ||
} |
Oops, something went wrong.