View Javadoc
1   package com.foxinmy.weixin4j.pay.payment.mch;
2   
3   import com.foxinmy.weixin4j.pay.type.TradeType;
4   
5   import javax.xml.bind.annotation.*;
6   
7   /**
8    * V3预订单信息
9    * 
10   * @className PrePay
11   * @author jinyu(foxinmy@gmail.com)
12   * @date 2014年10月21日
13   * @since JDK 1.6
14   * @see
15   */
16  @XmlRootElement
17  @XmlAccessorType(XmlAccessType.FIELD)
18  public class PrePay extends MerchantResult {
19  
20  	private static final long serialVersionUID = -8430005768959715444L;
21  
22  	/**
23  	 * 调用接口提交的交易类型,取值如下:JSAPI,NATIVE,APP,
24  	 * 
25  	 * @see com.foxinmy.weixin4j.pay.type.TradeType
26  	 */
27  	@XmlElement(name = "trade_type")
28  	private TradeType tradeType;
29  	/**
30  	 * 微信生成的预支付回话标识,用于后续接口调用中使用,该值有效期为2小时
31  	 */
32  	@XmlElement(name = "prepay_id")
33  	private String prepayId;
34  	/**
35  	 * 对于trade_type 为 NATIVE 或者 MWEB 是有 返回</br> NATVIE支付:可直接生成二维码展示出来进行扫码支付可能为空</br>
36  	 * MWEB支付:可直接作为跳转支付的URL
37  	 */
38  	@XmlElements({ @XmlElement(name = "code_url"),
39  			@XmlElement(name = "mweb_url") })
40  	private String payUrl;
41  
42  	protected PrePay() {
43  		// jaxb required
44  	}
45  
46  	public PrePay(String returnCode, String returnMsg) {
47  		super(returnCode, returnMsg);
48  	}
49  
50  	public TradeType getTradeType() {
51  		return tradeType;
52  	}
53  
54  	public void setTradeType(TradeType tradeType) {
55  		this.tradeType = tradeType;
56  	}
57  
58  	public String getPrepayId() {
59  		return prepayId;
60  	}
61  
62  	public void setPrepayId(String prepayId) {
63  		this.prepayId = prepayId;
64  	}
65  
66  	public String getPayUrl() {
67  		return payUrl;
68  	}
69  
70  	public void setPayUrl(String payUrl) {
71  		this.payUrl = payUrl;
72  	}
73  
74  	@Override
75  	public String toString() {
76  		return "PrePay [tradeType=" + tradeType + ", prepayId=" + prepayId
77  				+ ", payUrl=" + payUrl + ", " + super.toString() + "]";
78  	}
79  }