You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace fubei\pay;
use fubei\Base;
class WxConfig extends Base
{
/**
* 微信参数配置查询(查询已经配置的微信支付公众号appid关注公众号appid授权目录)
* @param int $store_id 付呗系统的门店id
* @date 2021-11-22
*/
public function wxConfigQuery($store_id)
{
//公共参数
$common_data = [
'method' => 'fbpay.order.wxconfig.query',
];
//业务参数
$biz_content = [
'merchant_id' => $this->config['merchant_id'],
'store_id' => $store_id,
];
$result = $this->actionApi($common_data, $biz_content);
// 记录日志
$uid = defined('UID') ? UID : '';
platformLog([
'common_data' => $common_data,
'biz_content' => $biz_content,
], $result, 'fubei_wx_config_query_uid_' . $uid);
return $result;
}
/**
* 微信参数配置(支持配置微信支付公众号、小程序 appid授权目录)
* @param int $store_id 付呗系统的门店id
* @param string $app_id 支付所使用的公众号appid 支持使用小程序app_id
* @param string $account_type 00公众号默认 01小程序
* @param string $jsapi_path 支付授权目录
* @remark 使用本接口配置sub_appid时应保证sub_appid主体与付呗商户主体一致或sub_appdid主体与渠道号主体一致
* @remark 如果支付授权目录设置为顶级域名例如https://www.weixin.com/ ),那么只校验顶级域名,不校验后缀;(推荐此种方式)
* @date 2021-11-22
*/
public function wxConfig($store_id, $app_id, $account_type = '00', $jsapi_path = '')
{
//公共参数
$common_data = [
'method' => 'fbpay.order.wxconfig',
];
//业务参数
$biz_content = [
// 'merchant_id' => $this->config['merchant_id'],
'store_id' => $store_id
];
if (!empty($app_id)) {
$biz_content['sub_appid'] = $app_id;
}
if (!empty($account_type)) {
$biz_content['account_type'] = $account_type;
}
if (!empty($jsapi_path)) {
$biz_content['jsapi_path'] = $jsapi_path;
}
$result = $this->actionApi($common_data, $biz_content);
// 记录日志
$uid = defined('UID') ? UID : '';
platformLog([
'common_data' => $common_data,
'biz_content' => $biz_content,
], $result, 'fubei_wx_config_uid_' . $uid);
return $result;
}
}