Skip to content

Commit

Permalink
拼多多SDK更新
Browse files Browse the repository at this point in the history
  • Loading branch information
yumufeng committed Oct 30, 2019
1 parent eae74e3 commit 5e447fa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 67 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
}
],
"require": {
"php": ">=7.0"
"php": ">=7.0",
"yumufeng/curl-swoole": "^1.0"
},
"autoload": {
"classmap": [
Expand All @@ -20,7 +21,7 @@
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.laravel-china.org"
"url": "https://mirrors.aliyun.com/composer/"
}
}
}
61 changes: 0 additions & 61 deletions src/Tools/Helpers.php

This file was deleted.

3 changes: 2 additions & 1 deletion src/pddUnionGateWay.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace pddUnionSdk;

use pddUnionSdk\Tools\Helpers;
use yumufeng\curl\Curl;

/**
* 多多客网关
Expand Down Expand Up @@ -83,7 +84,7 @@ public function send($method, $params, $data_type = 'JSON')
$params['timestamp'] = strval(time());
$params['sign'] = $this->signature($params);
try {
$response = $this->isCurl == false ? Helpers::curl_post(self::URL, $params): Helpers::fpm_curl_post(self::URL, $params);
$response = $this->isCurl == false ? Curl::curl_post(self::URL, $params): Curl::fpm_curl_post(self::URL, $params);
$info = strtolower($data_type) == 'json' ? json_decode($response, true) : $response;
if (isset($info['error_response'])) {
$this->pddUnionFactory->setError($info['error_response']['error_msg']);
Expand Down
2 changes: 1 addition & 1 deletion test/fpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$config = [
'appId' => '',
'appSk' => '',
'ddkId' => ''
'ddkId' => '1628880'
];
//'1628880_31417969', true
$pdd = new \pddUnionSdk\pddUnionFactory($config);
Expand Down
3 changes: 1 addition & 2 deletions test/swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public function onRequest(\swoole_http_request $request, \swoole_http_response $
if ($info === false) {
var_dump($pdd->getError());
}
var_dump($info);
$response->end('index');
$response->end(json_encode($info));
}

}
Expand Down

0 comments on commit 5e447fa

Please sign in to comment.