5 Commits

Author SHA1 Message Date
as2252258 c74c3b004b Default Changelist 2023-08-18 15:34:49 +08:00
as2252258 b92ea7df9f Default Changelist 2023-08-18 15:31:47 +08:00
as2252258 72a7c58bc4 Default Changelist 2023-07-20 17:42:42 +08:00
as2252258 e1959752e1 Default Changelist 2023-07-18 00:24:58 +08:00
as2252258 361ad4538f Default Changelist 2023-07-18 00:19:13 +08:00
4 changed files with 95 additions and 85 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
}, },
"require": { "require": {
"php": ">= 8.0", "php": ">= 8.0",
"game-worker/kiri-client": "dev-master", "game-worker/kiri-client": "~v2.6",
"game-worker/kiri-container": "~v1.9", "game-worker/kiri-container": "~v1.9",
"psr/container": "*" "psr/container": "*"
}, },
+10 -1
View File
@@ -536,11 +536,20 @@ class Config
$this->usrSwoole = $usrSwoole; $this->usrSwoole = $usrSwoole;
} }
/**
* @param array $configs
*/
public function __construct(array $configs)
{
$this->setConfigs($configs);
}
/** /**
* @param array $configs * @param array $configs
* @return $this * @return $this
*/ */
public function setConfigs(array $configs): static protected function setConfigs(array $configs): static
{ {
if (empty($configs)) { if (empty($configs)) {
return $this; return $this;
+5 -6
View File
@@ -10,21 +10,20 @@ namespace wchat\qq;
use Exception; use Exception;
use Kiri\Client; use Kiri\Client;
use wchat\common\HttpClient;
use wchat\common\Result; use wchat\common\Result;
use wchat\common\Help; use wchat\common\Help;
class Recharge extends SmallProgram class Recharge extends SmallProgram
{ {
private $money = 0; private float $money = 0;
private $orderNo; private string $orderNo;
private $data = []; private array $data = [];
private $spill_create_ip = ''; private string $spill_create_ip = '';
private $uniformer = 'https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi'; private string $uniformer = '/cgi-bin/pay/qpay_unified_order.cgi';
/** /**
* @param $value * @param $value
+3 -1
View File
@@ -431,8 +431,10 @@ class Redhat extends SmallProgram
*/ */
public function redEnvelopes(): Result public function redEnvelopes(): Result
{ {
$client = new Client('qpay.qq.com', 443, true); $client = new Client('api.qpay.qq.com', 443, true);
$client->withHeader(['Content-Type' => 'application/json']); $client->withHeader(['Content-Type' => 'application/json']);
$client->withSslKeyFile($this->config->getSslKey());
$client->withSslCertFile($this->config->getSslCert());
$client->post($this->sendUrl, $this->generate()); $client->post($this->sendUrl, $this->generate());
$client->close(); $client->close();
if (!in_array($client->getStatusCode(), [101, 200, 201])) { if (!in_array($client->getStatusCode(), [101, 200, 201])) {