|
@@ -128,6 +128,7 @@ class Pay extends Common
|
|
|
// 微信公众号,小程序支付,必须有 openid
|
|
|
if ($payment == 'wechat') {
|
|
|
if (in_array($platform, ['WechatOfficialAccount', 'WechatMiniProgram'])) {
|
|
|
+ $openid = $user->wechat_openid;
|
|
|
if (isset($openid) && $openid) {
|
|
|
// 如果传的有 openid
|
|
|
$order_data['payer']['openid'] = $openid;
|
|
@@ -164,6 +165,11 @@ class Pay extends Common
|
|
|
'notifyurl' => config('pay_notify_url').'/api/notify/recharge_notify_base/paytype/'.$payment,
|
|
|
'returnurl' => '',
|
|
|
];
|
|
|
+ if ($payment == 'wechat') {
|
|
|
+ if (in_array($platform, ['WechatOfficialAccount', 'WechatMiniProgram'])) {
|
|
|
+ $params['openid'] = $user->wechat_openid;
|
|
|
+ }
|
|
|
+ }
|
|
|
$res = Service::submitOrder($params);
|
|
|
|
|
|
if($payment == 'wechat'){
|