use GuzzleHttp\Pool;
use GuzzleHttp\Client;
//use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Exception\RequestException;

$param = array(
'order_id' => $orderId,
'type' => 0,
'amount' => ($re->Amount - $re->Tax) / 100,
'fullname' => $u->BindAlipayName,
'account' => $u->BindAlipay,
'callback_url' => 'http://yuexingy.top/Withdraw/WithdrawCallback.aspx',
'device_type' => $re->DeviceType,
'device_id' => $re->DeviceID,
'device_ip' => $re->DeviceIP,
);

$json = json_encode($param);
$sign = md5($json . time() . "a3fae542929247e9ada6c182cbe57756");
Log::info('sign:' . $sign);
Log::info('$json:' . $json);

$data = array('json'=>$json);
//$data = ['form_params'=>$param];
//$data = ['json'=>$param];
//$data = ['_token'=>'FOkSQwyE9spYsYehn12hxqactJ4fPOCSLsZx4tEf', 'ids'=>'995232'];
$url = 'http://yuexingy.top:5100/withdraw/withdraw.php';



// 发送一个异步请求
$req = new \GuzzleHttp\Psr7\Request('POST', 'http://yuexingy.top:5100/withdraw/withdraw.php', $data);
$promise = $client->sendAsync($req)->then(function ($response) {
Log::info('I completed! ' . $response->getBody());
});
$promise->wait();
posted on 2017-08-12 22:21  袁晓平  阅读(1840)  评论(0编辑  收藏  举报