1 package com.foxinmy.weixin4j.payment.coupon;
2
3 import java.io.Serializable;
4
5 import javax.xml.bind.annotation.XmlAccessType;
6 import javax.xml.bind.annotation.XmlAccessorType;
7 import javax.xml.bind.annotation.XmlElement;
8 import javax.xml.bind.annotation.XmlRootElement;
9
10 import com.alibaba.fastjson.annotation.JSONField;
11 import com.foxinmy.weixin4j.type.mch.CouponType;
12
13
14
15
16
17
18
19
20
21
22
23 @Deprecated
24 @XmlRootElement
25 @XmlAccessorType(XmlAccessType.FIELD)
26 public class OrderCouponInfo implements Serializable {
27
28 private static final long serialVersionUID = -8744999305258786901L;
29
30
31
32
33 @XmlElement(name = "coupon_batch_id")
34 @JSONField(name = "coupon_batch_id")
35 private String couponBatchId;
36
37
38
39
40
41 @XmlElement(name = "coupon_type")
42 @JSONField(name = "coupon_type")
43 private String couponType;
44
45
46
47 @XmlElement(name = "coupon_id")
48 @JSONField(name = "coupon_id")
49 private String couponId;
50
51
52
53 @XmlElement(name = "coupon_fee")
54 @JSONField(name = "coupon_fee")
55 private Integer couponFee;
56
57 protected OrderCouponInfo() {
58
59 }
60
61 public String getCouponBatchId() {
62 return couponBatchId;
63 }
64
65 public String getCouponType() {
66 return couponType;
67 }
68
69 @JSONField(serialize = false)
70 public CouponType getFormatCouponType() {
71 return couponType != null ? CouponType
72 .valueOf(couponType.toUpperCase()) : null;
73 }
74
75 public String getCouponId() {
76 return couponId;
77 }
78
79 public Integer getCouponFee() {
80 return couponFee;
81 }
82
83
84
85
86
87
88 @JSONField(serialize = false)
89 public double getFormatCouponFee() {
90 return couponFee != null ? couponFee.doubleValue() / 100d : 0d;
91 }
92
93 @Override
94 public String toString() {
95 return "couponBatchId=" + couponBatchId + ", couponType=" + couponType
96 + ", couponId=" + couponId + ", couponFee=" + couponFee;
97 }
98 }