H5纯签约
该方式适用于手机、平板电脑等使用H5浏览器的设备场景使用微信签约扣款。商户在网站前端通过微信支付H5纯签约接口与用户签订委托扣款协议,再通过后台接口申请扣款来完成代扣交易。
请求参数 | 类型 | 描述 |
---|---|---|
query | object | 声明请求的查询参数 |
appid | string | 应用ID |
mch_id | string | 商户号 |
plan_id | string | 模板id |
contract_code | string | 签约协议号 |
request_serial | integer | 请求序列号 |
contract_display_account | string | 用户账户展示名称 |
notify_url | string | 回调通知url |
version | string | 版本号1.0 枚举值 |
sign | string | 签名 |
sign_type | string | 签名类型MD5 | HMAC-SHA256 枚举值之一 |
timestamp | string | 时间戳 |
return_appid | string | 回调应用appid |
php
$instance->v2->papay->h5entrustweb->getAsync([
'query' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '1200009811',
'plan_id' => '12535',
'contract_code' => '100000',
'request_serial' => '1000',
'contract_display_account' => '微信代扣',
'notify_url' => 'https://weixin.qq.com',
'version' => '1.0',
'sign' => 'C380BEC2BFD727A4B6845133519F3AD6',
'timestamp' => '1414488825',
'clientip' => '119.145.83.6',
'deviceid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'mobile' => '18933432355',
'email' => 'aobama@whitehouse.com',
'qq' => '100243',
'openid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'creid' => '110102199701011000',
'outerid' => 'user123',
'return_appid' => 'wxcbda96de0b165486',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance->chain('v2/papay/h5entrustweb')->getAsync([
'query' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '1200009811',
'plan_id' => '12535',
'contract_code' => '100000',
'request_serial' => '1000',
'contract_display_account' => '微信代扣',
'notify_url' => 'https://weixin.qq.com',
'version' => '1.0',
'sign' => 'C380BEC2BFD727A4B6845133519F3AD6',
'timestamp' => '1414488825',
'clientip' => '119.145.83.6',
'deviceid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'mobile' => '18933432355',
'email' => 'aobama@whitehouse.com',
'qq' => '100243',
'openid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'creid' => '110102199701011000',
'outerid' => 'user123',
'return_appid' => 'wxcbda96de0b165486',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$instance['v2/papay/h5entrustweb']->getAsync([
'query' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '1200009811',
'plan_id' => '12535',
'contract_code' => '100000',
'request_serial' => '1000',
'contract_display_account' => '微信代扣',
'notify_url' => 'https://weixin.qq.com',
'version' => '1.0',
'sign' => 'C380BEC2BFD727A4B6845133519F3AD6',
'timestamp' => '1414488825',
'clientip' => '119.145.83.6',
'deviceid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'mobile' => '18933432355',
'email' => 'aobama@whitehouse.com',
'qq' => '100243',
'openid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'creid' => '110102199701011000',
'outerid' => 'user123',
'return_appid' => 'wxcbda96de0b165486',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
})
->wait();
php
$response = $instance->v2->papay->h5entrustweb->get([
'query' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '1200009811',
'plan_id' => '12535',
'contract_code' => '100000',
'request_serial' => '1000',
'contract_display_account' => '微信代扣',
'notify_url' => 'https://weixin.qq.com',
'version' => '1.0',
'sign' => 'C380BEC2BFD727A4B6845133519F3AD6',
'timestamp' => '1414488825',
'clientip' => '119.145.83.6',
'deviceid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'mobile' => '18933432355',
'email' => 'aobama@whitehouse.com',
'qq' => '100243',
'openid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'creid' => '110102199701011000',
'outerid' => 'user123',
'return_appid' => 'wxcbda96de0b165486',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance->chain('v2/papay/h5entrustweb')->get([
'query' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '1200009811',
'plan_id' => '12535',
'contract_code' => '100000',
'request_serial' => '1000',
'contract_display_account' => '微信代扣',
'notify_url' => 'https://weixin.qq.com',
'version' => '1.0',
'sign' => 'C380BEC2BFD727A4B6845133519F3AD6',
'timestamp' => '1414488825',
'clientip' => '119.145.83.6',
'deviceid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'mobile' => '18933432355',
'email' => 'aobama@whitehouse.com',
'qq' => '100243',
'openid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'creid' => '110102199701011000',
'outerid' => 'user123',
'return_appid' => 'wxcbda96de0b165486',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
php
$response = $instance['v2/papay/h5entrustweb']->get([
'query' => [
'appid' => 'wxcbda96de0b165486',
'mch_id' => '1200009811',
'plan_id' => '12535',
'contract_code' => '100000',
'request_serial' => '1000',
'contract_display_account' => '微信代扣',
'notify_url' => 'https://weixin.qq.com',
'version' => '1.0',
'sign' => 'C380BEC2BFD727A4B6845133519F3AD6',
'timestamp' => '1414488825',
'clientip' => '119.145.83.6',
'deviceid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'mobile' => '18933432355',
'email' => 'aobama@whitehouse.com',
'qq' => '100243',
'openid' => 'baf04e6bbbd06f7b1a197d18ed53b7f1',
'creid' => '110102199701011000',
'outerid' => 'user123',
'return_appid' => 'wxcbda96de0b165486',
],
]);
print_r(\WeChatPay\Transformer::toArray((string) $response->getBody()));
返回字典 | 类型 | 描述 |
---|---|---|
return_code | string | 返回状态码SUCCESS | FAIL 枚举值之一 |
return_msg | string | 返回信息 |
参阅 官方文档