获取沙箱环境密钥
仿真系统与生产环境完全独立,包括存储层。商户在仿真系统所做的所有交易(如下单、支付、查询)均为无资金流的假数据,即:用户无需真实扣款,商户也不会有资金入账。代金券同理,沙箱环境中无需商户真实制券与发券,亦不会出现真实扣券情况。
请求参数 | 类型 | 描述 |
---|---|---|
xml | object | 声明请求的XML 数据结构 |
mch_id | string | 商户号 |
php
$instance->v2->xdc->apiv2getsignkey->sign->getsignkey->postAsync([
'xml' => [
'mch_id' => '1900000109',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string)$response->getBody()));
})
->wait();
php
$instance->chain('v2/xdc/apiv2getsignkey/sign/getsignkey')->postAsync([
'xml' => [
'mch_id' => '1900000109',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string)$response->getBody()));
})
->wait();
php
$instance['v2/xdc/apiv2getsignkey/sign/getsignkey']->postAsync([
'xml' => [
'mch_id' => '1900000109',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string)$response->getBody()));
})
->wait();
php
$response = $instance->v2->xdc->apiv2getsignkey->sign->getsignkey->post([
'xml' => [
'mch_id' => '1900000109',
],
]);
print_r(\WeChatPay\Transformer::toArray((string)$response->getBody()));
php
$response = $instance->chain('v2/xdc/apiv2getsignkey/sign/getsignkey')->post([
'xml' => [
'mch_id' => '1900000109',
],
]);
print_r(\WeChatPay\Transformer::toArray((string)$response->getBody()));
php
$response = $instance['v2/xdc/apiv2getsignkey/sign/getsignkey']->post([
'xml' => [
'mch_id' => '1900000109',
],
]);
print_r(\WeChatPay\Transformer::toArray((string)$response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 返回信息 |
mch_id | string | 商户号 |
sandbox_signkey | string | 沙箱密钥 |
重要提示
参阅 官方沙箱环境文档