Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

是不是还是需要安装Workerman才行 #9

Closed
jingmian opened this issue Sep 11, 2018 · 15 comments
Closed

是不是还是需要安装Workerman才行 #9

jingmian opened this issue Sep 11, 2018 · 15 comments

Comments

@jingmian
Copy link

No description provided.

@xu42
Copy link
Owner

xu42 commented Sep 11, 2018

@jingmian workman的安装,工程目录 composer update即可

@jingmian
Copy link
Author

https://s1.ax1x.com/2018/09/12/ik0Th9.png
我这样设置后,然后composer update是否对?好像我无法拉取到你的项目下来

@xu42
Copy link
Owner

xu42 commented Sep 12, 2018

@jingmian 切到你的工程目录 执行git clone git@github.com:xu42/pay.git

@jingmian
Copy link
Author

有赞设置
代码设置
网站提示设置不合法
我已经上传到服务器了,并启动成功,但提示wrong server pay config出来,我设置key有错没

@xu42
Copy link
Owner

xu42 commented Sep 12, 2018

@jingmian kdtId错误

@jingmian
Copy link
Author

哈哈,可以了,谢谢。
我还想问下,我这个开发者模式的kdtId,clientId,clientSecret如果店铺没有续费订购他们产品,过期后也会失效吗

@xu42
Copy link
Owner

xu42 commented Sep 12, 2018

@jingmian 如果你是微商城的话,到期不续费无法提现。

@jingmian
Copy link
Author

明白了,对了,还有一个我付款后,它没有像你的demo那样,二维码显示那里变为“支付成功"是不是哪里还需要再设置

@xu42
Copy link
Owner

xu42 commented Sep 14, 2018

@jingmian 根据报错信息排查一下

@wenlanhuitai
Copy link

现在还可以用吗?

@xu42
Copy link
Owner

xu42 commented Sep 21, 2018

@wenlanhuitai 可以的,可以关注 dmeo

@wenlanhuitai
Copy link

wenlanhuitai commented Sep 21, 2018

阿里云ECS :
网页报错: (index):61 WebSocket connection to 'ws://www.xxxxxx.com:11942/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

代码如下:
`<?php
require_once DIR . '/../vendor/autoload.php';

use Service\PayService;
use Workerman\WebServer;
use Workerman\Worker;

$webServer = new WebServer('http://127.0.0.1:80');
$webServer->addRoot('localhost:80', DIR . '/../public/');
$webServer->count = 3;

// $context = [
// 'ssl' => [
// 'local_cert' => '',
// 'local_pk' => '',
// 'verify_peer' => false,
// ],
// ];
$webSocketServer = new Worker('websocket://0.0.0.0:11942');
$webSocketServer->count = 1;
// $webSocketServer->transport = 'ssl';
$webSocketServer->userConnections = [];
$webSocketServer->userQRs = [];
$webSocketServer->onWorkerStart = function () use ($webSocketServer) {
$textWorker = new Worker('Text://127.0.0.1:11900');
$textWorker->onMessage = 'Service\InnerTextServer::onMessage';
$textWorker->listen();
};
$webSocketServer->onMessage = function ($connection, $message) use ($webSocketServer) {
$arr = explode(',', $message);
if (!isset($connection->userId)) {
$connection->userId = $arr[0];
$webSocketServer->userConnections[$connection->userId] = $connection;
}
(new PayService)->create($connection, $arr[1], $arr[2]);
};

Worker::runAll();`

@xu42
Copy link
Owner

xu42 commented Sep 22, 2018

@wenlanhuitai 挡火拦截了

@wenlanhuitai
Copy link

@xu42 谢谢,已经可以支付了,但是有一个疑问:扫码和支付成功没有回调通知。

有一个地方不太了解,什么意思?textWorker 主要是干什么用的呢?

$webSocketServer->onWorkerStart = function () use ($webSocketServer) {
$textWorker = new Worker('Text://127.0.0.1:20000');
$textWorker->onMessage = 'Service\InnerTextServer::onMessage';
$textWorker->listen();
};

@xu42
Copy link
Owner

xu42 commented Sep 27, 2018

@wenlanhuitai 回调信息传递给前端ws

@xu42 xu42 closed this as completed Oct 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants