View Javadoc
1   package com.foxinmy.weixin4j.pay.payment;
2   
3   import com.alibaba.fastjson.annotation.JSONField;
4   import com.foxinmy.weixin4j.util.DateUtil;
5   import com.foxinmy.weixin4j.util.RandomUtil;
6   
7   import javax.xml.bind.annotation.*;
8   
9   @XmlRootElement
10  @XmlAccessorType(XmlAccessType.FIELD)
11  public class PayRequest extends PayBaseInfo {
12  
13  	private static final long serialVersionUID = -453746488398523883L;
14  
15  	/**
16  	 * 订单详情扩展 订单信息组成该字符串
17  	 */
18  	@XmlElement(name = "Package")
19  	@JSONField(name = "package")
20  	private String packageInfo;
21  
22  	/**
23  	 * 冗余字段
24  	 */
25  	@XmlTransient
26  	@JSONField(serialize = false)
27  	private String prepayId;
28  	/**
29  	 * 冗余字段
30  	 */
31  	@XmlTransient
32  	@JSONField(serialize = false)
33  	private String partnerId;
34  
35  
36  	protected PayRequest() {
37  		// jaxb required
38  	}
39  
40  	public PayRequest(String appId, String packageInfo) {
41  		super(appId, DateUtil.timestamp2string(), RandomUtil.generateString(16));
42  		this.packageInfo = packageInfo;
43  	}
44  
45  	public String getPackageInfo() {
46  		return packageInfo;
47  	}
48  
49  	public void setPackageInfo(String packageInfo) {
50  		this.packageInfo = packageInfo;
51  	}
52  
53  	public String getPrepayId() {
54  		return prepayId;
55  	}
56  
57  	public void setPrepayId(String prepayId) {
58  		this.prepayId = prepayId;
59  	}
60  
61  	public String getPartnerId() {
62  		return partnerId;
63  	}
64  
65  	public void setPartnerId(String partnerId) {
66  		this.partnerId = partnerId;
67  	}
68  
69  
70  	@Override
71  	public String toString() {
72  		return "package" + packageInfo + ", prepayId=" + prepayId
73  				+ super.toString();
74  	}
75  }