Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b716e5

Browse files
committed
支持-普通服务商模式-微信收款
1 parent 6a9db34 commit 3b716e5

9 files changed

+86
-0
lines changed

src/BaseAbstractGateway.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,44 @@ public function getMchId()
4747
return $this->getParameter('mch_id');
4848
}
4949

50+
/**
51+
* 子商户id
52+
*
53+
* @return mixed
54+
*/
55+
public function getSubMchId()
56+
{
57+
return $this->getParameter('sub_mch_id');
58+
}
59+
60+
61+
/**
62+
* @param mixed $subMchId
63+
*/
64+
public function setSubMchId($mchId)
65+
{
66+
$this->setParameter('sub_mch_id', $mchId);
67+
}
68+
69+
70+
/**
71+
* 子商户 app_id
72+
*
73+
* @return mixed
74+
*/
75+
public function getSubAppId()
76+
{
77+
return $this->getParameter('sub_appid');
78+
}
79+
80+
81+
/**
82+
* @param mixed $subAppId
83+
*/
84+
public function setSubAppId($subAppId)
85+
{
86+
$this->setParameter('sub_appid', $subAppId);
87+
}
5088

5189
public function setNotifyUrl($url)
5290
{

src/Message/BaseAbstractRequest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,40 @@ public function setMchId($mchId)
6363
{
6464
$this->setParameter('mch_id', $mchId);
6565
}
66+
67+
/**
68+
* @return mixed
69+
*/
70+
public function getSubMchId()
71+
{
72+
return $this->getParameter('sub_mch_id');
73+
}
74+
75+
76+
/**
77+
* @param mixed $subMchId
78+
*/
79+
public function setSubMchId($mchId)
80+
{
81+
$this->setParameter('sub_mch_id', $mchId);
82+
}
83+
84+
/**
85+
* 子商户 app_id
86+
*
87+
* @return mixed
88+
*/
89+
public function getSubAppId()
90+
{
91+
return $this->getParameter('sub_appid');
92+
}
93+
94+
95+
/**
96+
* @param mixed $subAppId
97+
*/
98+
public function setSubAppId($subAppId)
99+
{
100+
$this->setParameter('sub_appid', $subAppId);
101+
}
66102
}

src/Message/CloseOrderRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public function getData()
3131
$data = array(
3232
'appid' => $this->getAppId(),
3333
'mch_id' => $this->getMchId(),
34+
'sub_appid' => $this->getSubAppId(),
35+
'sub_mch_id' => $this->getSubMchId(),
3436
'out_trade_no' => $this->getOutTradeNo(),
3537
'nonce_str' => md5(uniqid()),
3638
);

src/Message/CreateMicroOrderRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function getData()
3030
$data = array(
3131
'appid' => $this->getAppId(),//*
3232
'mch_id' => $this->getMchId(),
33+
'sub_mch_id' => $this->getSubMchId(),
3334
'device_info' => $this->getDeviceInfo(),//*
3435
'body' => $this->getBody(),//*
3536
'detail' => $this->getDetail(),

src/Message/CreateOrderRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public function getData()
4545
$data = array(
4646
'appid' => $this->getAppId(),//*
4747
'mch_id' => $this->getMchId(),
48+
'sub_appid' => $this->getSubAppId(),
49+
'sub_mch_id' => $this->getSubMchId(),
4850
'device_info' => $this->getDeviceInfo(),//*
4951
'body' => $this->getBody(),//*
5052
'detail' => $this->getDetail(),

src/Message/QueryOrderRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function getData()
3535
$data = array(
3636
'appid' => $this->getAppId(),
3737
'mch_id' => $this->getMchId(),
38+
'sub_appid' => $this->getSubAppId(),
39+
'sub_mch_id' => $this->getSubMchId(),
3840
'transaction_id' => $this->getTransactionId(),
3941
'out_trade_no' => $this->getOutTradeNo(),
4042
'nonce_str' => md5(uniqid()),

src/Message/QueryRefundRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function getData()
3939
$data = array(
4040
'appid' => $this->getAppId(),
4141
'mch_id' => $this->getMchId(),
42+
'sub_appid' => $this->getSubAppId(),
43+
'sub_mch_id' => $this->getSubMchId(),
4244
'device_info' => $this->getDeviceInfo(),
4345
'transaction_id' => $this->getTransactionId(),
4446
'out_trade_no' => $this->getOutTradeNo(),

src/Message/RefundOrderRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public function getData()
3232
$data = array(
3333
'appid' => $this->getAppId(),
3434
'mch_id' => $this->getMchId(),
35+
'sub_appid' => $this->getSubAppId(),
36+
'sub_mch_id' => $this->getSubMchId(),
3537
'device_info' => $this->getDeviceInfo(),//<>
3638
'transaction_id' => $this->getTransactionId(),
3739
'out_trade_no' => $this->getOutTradeNo(),

src/Message/ShortenUrlRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function getData()
3131
$data = array(
3232
'appid' => $this->getAppId(),
3333
'mch_id' => $this->getMchId(),
34+
'sub_mch_id'=> $this->getSubMchId(),
3435
'long_url' => $this->getLongUrl(),
3536
'nonce_str' => md5(uniqid()),
3637
);

0 commit comments

Comments
 (0)