WxUnifiedOrder.php
4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?php
/**
**/
require_once IA_ROOT . "/addons/zh_cjdianc/inc/wxlib/WxPay.Exception.php";
require_once IA_ROOT . "/addons/zh_cjdianc/inc/wxlib/WxPay.Data.php";
/**
*
* 提交支付用的对象
* @author widyhu
*
*/
class WxUnifiedOrder extends WxPayDataBase
{
/**
* 设置APPID
* @param string $value
**/
public function SetAppId($value)
{
$this->values['appid'] = $value;
}
/**
* 获取微信分配的公众账号ID的值
* @return 值
**/
public function GetAppId()
{
return $this->values['appid'];
}
public function IsAppIdSet()
{
return array_key_exists('appid', $this->values);
}
/**
* 设置商户号ID
* @param string $value
**/
public function SetMchId($value)
{
$this->values['mch_id'] = $value;
}
/**
* 获取商户号ID
* @return 值
**/
public function GetMchId()
{
return $this->values['mch_id'];
}
/**
* 判断微信支付分配的商户号是否存在
* @return true 或 false
**/
public function IsMchIdSet()
{
return array_key_exists('mch_id', $this->values);
}
/**
* 设置随机字符串,不长于32位。推荐随机数生成算法
* @param string $value
**/
public function SetNonceStr($value)
{
$this->values['nonce_str'] = $value;
}
/**
* 获取随机字符串,不长于32位。推荐随机数生成算法的值
* @return 值
**/
public function GetNonceStr()
{
return $this->values['nonce_str'];
}
/**
* 判断随机字符串,不长于32位。推荐随机数生成算法是否存在
* @return true 或 false
**/
public function IsNonceStrSet()
{
return array_key_exists('nonce_str', $this->values);
}
/**
* 设置商户系统内部的订单号,out_trade_no
* @param string $value
**/
public function SetOutTradeNo($value)
{
$this->values['out_trade_no'] = $value;
}
/**
* 获取商户系统内部的订单号,partner_trade_no,
* @return 值
**/
public function GetOutTradeNo()
{
return $this->values['out_trade_no'];
}
/**
* 判断商户系统内部的订单号,out_trade_no二选一
* @return true 或 false
**/
public function IsOutTradeNoSet()
{
return array_key_exists('out_trade_no', $this->values);
}
// 设置body
public function SetBody($value)
{
$this->values['body'] = $value;
}
/**
* IP地址
* @param string $value
**/
public function SetSpbilCreateIp($value)
{
$this->values['spbill_create_ip'] = $value;
}
/**
* IP地址
* @return 值
**/
public function GetSpbilCreateIp()
{
return $this->values['spbill_create_ip'];
}
/**
* IP地址
* @return true 或 false
**/
public function IsSpbilCreateIpSet()
{
return array_key_exists('spbill_create_ip', $this->values);
}
/**
* OpenId
* @param string $value
**/
public function SetOpenId($value)
{
$this->values['openid'] = $value;
}
/**
* openid
* @return 值
**/
public function GetOpenId()
{
return $this->values['openid'];
}
/**
* IsOpenIdSet
* @return true 或 false
**/
public function IsOpenIdSet()
{
return array_key_exists('openid', $this->values);
}
/**
* 收款用户姓名
* @param string $value
**/
public function SetNotifyUrl($value)
{
$this->values['notify_url'] = $value;
}
/**
* 获取收款用户姓名
* @return 值
**/
public function GetNotifyUrl()
{
return $this->values['notify_url'];
}
/**
* 是否设置收款用户姓名
* @return true 或 false
**/
public function IsNotifyUrlSet()
{
return array_key_exists('notify_url', $this->values);
}
/**
* 设置金额
* @param string $value
**/
public function SetTotalFee($value)
{
$this->values['total_fee'] = $value;
}
/**
* 获取金额
* @return 值
**/
public function GetTotalFee()
{
return $this->values['total_fee'];
}
/**
* 判断金额是否设置
* @return true 或 false
**/
public function IsTotalFeeSet()
{
return array_key_exists('total_fee', $this->values);
}
public function SetTradeType($value = 'JSAPI')
{
$this->values['trade_type'] = $value;
}
public function SetAttach($value)
{
$this->values['attach'] = $value;
}
}