微信H5支付
parent
3b87d84079
commit
cf052f0047
|
|
@ -6,6 +6,7 @@ use App\Exceptions\WeChatPayException;
|
|||
use Closure;
|
||||
use EasyWeChat\Factory;
|
||||
use EasyWeChat\Payment\Application;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class WeChatPayService
|
||||
{
|
||||
|
|
@ -83,13 +84,11 @@ class WeChatPayService
|
|||
);
|
||||
}
|
||||
|
||||
$prepayId = $result['prepay_id'];
|
||||
|
||||
if ($params['trade_type'] === static::TRADE_TYPE_APP) {
|
||||
return $this->app->jssdk->appConfig($prepayId);
|
||||
}
|
||||
|
||||
return $this->app->jssdk->bridgeConfig($prepayId, false);
|
||||
return match ($params['trade_type']) {
|
||||
static::TRADE_TYPE_APP => $this->app->jssdk->appConfig($result['prepay_id']),
|
||||
static::TRADE_TYPE_H5 => Arr::only($result, ['mweb_url']),
|
||||
default => $this->app->jssdk->bridgeConfig($result['prepay_id'], false),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue