wechatpay-apiv3/wechatpay-php

请问境外支付如何使用apihk域名?

Closed this issue · 1 comments

运行环境

- OS:
- PHP:
- wechatpay-php:

描述你的问题现象

No response

初始化的时候,给base_uri参数,例如证书下载工具支持的一样:

$instance = Builder::factory([
'mchid' => $opts['mchid'],
'serial' => $opts['serialno'],
'privateKey' => \file_get_contents((string)$opts['privatekey']),
'certs' => &$certs,
'base_uri' => (string)($opts['baseuri'] ?? self::DEFAULT_BASE_URI),
]);

或者不增初始化参数,在每请求的options里增加base_uri也同样效果,例如:

https://github.com/TheNorthMemory/wechatpay-openapi/blob/master/src/V3/Global_/Transactions/Native.php#L17-L68

https://github.com/TheNorthMemory/wechatpay-openapi/blob/d1bb855c160fb35754a88516edad062593e698bb/src/V3/Settle/Settlements.php#L17-L27