mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-02 12:17:38 +08:00
优化代码
This commit is contained in:
parent
4596f55a20
commit
501372b7ce
@ -28,10 +28,17 @@ use Yansongda\Supports\Str;
|
||||
*/
|
||||
class Wechat implements GatewayApplicationInterface
|
||||
{
|
||||
const MODE_NORMAL = 'normal'; // 普通模式
|
||||
const MODE_DEV = 'dev'; // 沙箱模式
|
||||
const MODE_HK = 'hk'; // 香港钱包
|
||||
const MODE_SERVICE = 'service'; // 服务商
|
||||
// 普通模式
|
||||
const MODE_NORMAL = 'normal';
|
||||
|
||||
// 沙箱模式
|
||||
const MODE_DEV = 'dev';
|
||||
|
||||
// 香港钱包
|
||||
const MODE_HK = 'hk';
|
||||
|
||||
// 服务商
|
||||
const MODE_SERVICE = 'service';
|
||||
|
||||
/**
|
||||
* Config.
|
||||
|
@ -100,10 +100,9 @@ class Support
|
||||
$payload = array_merge($payload, is_array($order) ? $order : ['out_trade_no' => $order]);
|
||||
|
||||
$type = isset($order['type']) ? $order['type'].($order['type'] == 'app' ? '' : '_').'id' : 'app_id';
|
||||
|
||||
$payload['appid'] = $config->get($type, '');
|
||||
$mode = $config->get('mode', Wechat::MODE_NORMAL);
|
||||
if ($mode === Wechat::MODE_SERVICE) {
|
||||
|
||||
if ($config->get('mode', Wechat::MODE_NORMAL) === Wechat::MODE_SERVICE) {
|
||||
$payload['sub_appid'] = $config->get('sub_'.$type, '');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user