View Javadoc
1   package com.foxinmy.weixin4j.payment.mch;
2   
3   import javax.xml.bind.annotation.XmlElement;
4   
5   import com.alibaba.fastjson.annotation.JSONField;
6   import com.foxinmy.weixin4j.type.CurrencyType;
7   
8   /**
9    * 商户平台交易结果
10   * 
11   * @className MerchantTradeResult
12   * @author jinyu(foxinmy@gmail.com)
13   * @date 2016年7月21日
14   * @since JDK 1.7
15   * @see
16   * @deprecated 迁移到子模块weixin4j-pay
17   */
18  @Deprecated
19  public class MerchantTradeResult extends MerchantResult {
20  
21  	private static final long serialVersionUID = 4205906286092873877L;
22  	/**
23  	 * 微信支付订单号
24  	 */
25  	@XmlElement(name = "transaction_id")
26  	@JSONField(name = "transaction_id")
27  	private String transactionId;
28  	/**
29  	 * 商户订单号
30  	 */
31  	@XmlElement(name = "out_trade_no")
32  	@JSONField(name = "out_trade_no")
33  	private String outTradeNo;
34  	/**
35  	 * 订单总金额,单位为分
36  	 */
37  	@XmlElement(name = "total_fee")
38  	@JSONField(name = "total_fee")
39  	private Integer totalFee;
40  	/**
41  	 * 应结订单金额,单位为分:应结订单金额=订单金额-非充值代金券金额,应结订单金额<=订单金额。
42  	 */
43  	@XmlElement(name = "settlement_total_fee")
44  	@JSONField(name = "settlement_total_fee")
45  	private Integer settlementTotalFee;
46  	/**
47  	 * 货币类型,符合 ISO 4217 标准的三位字母代码,默认人民币:CNY
48  	 * 
49  	 * @see com.foxinmy.weixin4j.mp.type.CurrencyType
50  	 */
51  	@XmlElement(name = "fee_type")
52  	@JSONField(name = "fee_type")
53  	private String feeType;
54  	/**
55  	 * 现金支付金额
56  	 */
57  	@XmlElement(name = "cash_fee")
58  	@JSONField(name = "cash_fee")
59  	private Integer cashFee;
60  
61  	public Integer getCashFee() {
62  		return cashFee;
63  	}
64  
65  	/**
66  	 * <font color="red">调用接口获取单位为分,get方法转换为元方便使用</font>
67  	 * 
68  	 * @return 元单位
69  	 */
70  	@JSONField(serialize = false)
71  	public double getFormatCashFee() {
72  		return cashFee != null ? cashFee / 100d : 0d;
73  	}
74  
75  	public Integer getTotalFee() {
76  		return totalFee;
77  	}
78  
79  	/**
80  	 * <font color="red">调用接口获取单位为分,get方法转换为元方便使用</font>
81  	 * 
82  	 * @return 元单位
83  	 */
84  	@JSONField(serialize = false)
85  	public double getFormatTotalFee() {
86  		return totalFee != null ? totalFee / 100d : 0d;
87  	}
88  
89  	@JSONField(serialize = false)
90  	public CurrencyType getFormatFeeType() {
91  		return feeType != null ? CurrencyType.valueOf(feeType.toUpperCase())
92  				: null;
93  	}
94  
95  	public String getFeeType() {
96  		return feeType;
97  	}
98  
99  	public String getTransactionId() {
100 		return transactionId;
101 	}
102 
103 	public String getOutTradeNo() {
104 		return outTradeNo;
105 	}
106 
107 	public Integer getSettlementTotalFee() {
108 		return settlementTotalFee;
109 	}
110 
111 	/**
112 	 * <font color="red">调用接口获取单位为分,get方法转换为元方便使用</font>
113 	 * 
114 	 * @return 元单位
115 	 */
116 	@JSONField(serialize = false)
117 	public double getFormatSettlementTotalFee() {
118 		return settlementTotalFee != null ? settlementTotalFee / 100d : 0d;
119 	}
120 
121 	@Override
122 	public String toString() {
123 		return "transactionId=" + transactionId + ", outTradeNo=" + outTradeNo
124 				+ ", totalFee=" + totalFee + ", cashFee=" + cashFee
125 				+ ", feeType=" + feeType + ", settlementTotalFee="
126 				+ settlementTotalFee + ", " + super.toString();
127 	}
128 }