Skip to content

Commit 81d2182

Browse files
egzosnegzosn
authored andcommitted
支付宝转账(红包)订单
1 parent fe62fbf commit 81d2182

1 file changed

Lines changed: 155 additions & 0 deletions

File tree

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
package com.egzosn.pay.ali.bean;
2+
3+
import com.egzosn.pay.common.bean.TransferOrder;
4+
5+
import java.math.BigDecimal;
6+
import java.util.TreeMap;
7+
8+
/**
9+
* 支付转账(红包)订单
10+
*
11+
* @author egan
12+
* date 2020/5/18 21:08
13+
* email egzosn@gmail.com
14+
*/
15+
public class AliTransferOrder extends TransferOrder {
16+
17+
private String identity;
18+
private String identityType;
19+
20+
/**
21+
* 商户端的唯一订单号,对于同一笔转账请求,商户需保证该订单号唯一。
22+
*
23+
* @return 商户端的唯一订单号
24+
*/
25+
public String getOutBizNo() {
26+
return getOutNo();
27+
}
28+
29+
public void setOutBizNo(String outBizNo) {
30+
setOutNo(outBizNo);
31+
}
32+
33+
/**
34+
* 订单总金额,单位为元,精确到小数点后两位,STD_RED_PACKET产品取值范围[0.01,100000000];
35+
* TRANS_ACCOUNT_NO_PWD产品取值范围[0.1,100000000]
36+
*
37+
* @return 订单总金额
38+
*/
39+
public BigDecimal getTransAmount() {
40+
return getAmount();
41+
}
42+
43+
public void setTransAmount(BigDecimal transAmount) {
44+
setAmount(transAmount);
45+
}
46+
47+
/**
48+
* 转账业务的标题,用于在支付宝用户的账单里显示
49+
*
50+
* @return 转账业务的标题
51+
*/
52+
public String getOrderTitle() {
53+
return (String) getAttr("order_title");
54+
}
55+
56+
public void setOrderTitle(String orderTitle) {
57+
addAttr("order_title", orderTitle);
58+
}
59+
60+
/**
61+
* 描述特定的业务场景,可传的参数如下:
62+
* DIRECT_TRANSFER:单笔无密转账到支付宝/银行卡, B2C现金红包;
63+
* PERSONAL_COLLECTION:C2C现金红包-领红包
64+
*
65+
* @return 描述特定的业务场景
66+
*/
67+
public String getBizScene() {
68+
return (String) getAttr("biz_scene");
69+
}
70+
71+
public void setBizScene(String bizScene) {
72+
addAttr("biz_scene", bizScene);
73+
}
74+
75+
/**
76+
* 收款方信息
77+
*
78+
* @return 收款方信息
79+
*/
80+
private TreeMap<String, Object> getPayeeinfo() {
81+
Object payeeInfo = getAttr("payee_info");
82+
if (null == payeeInfo ){
83+
payeeInfo = new TreeMap<>();
84+
addAttr("payee_info", payeeInfo);
85+
}else if (payeeInfo instanceof TreeMap){
86+
return (TreeMap<String, Object>) payeeInfo;
87+
}
88+
89+
return null;
90+
91+
}
92+
93+
/**
94+
* 参与方的唯一标识
95+
*
96+
* @return 参与方的唯一标识
97+
*/
98+
public String getIdentity() {
99+
return identity;
100+
}
101+
102+
public void setIdentity(String identity) {
103+
this.identity = identity;
104+
getPayeeinfo().put("identity", identity);
105+
}
106+
107+
/**
108+
* 参与方的标识类型,目前支持如下类型:
109+
* 1、ALIPAY_USER_ID 支付宝的会员ID
110+
* 2、ALIPAY_LOGON_ID:支付宝登录号,支持邮箱和手机号格式
111+
*
112+
* @return 参与方的标识类型
113+
*/
114+
public String getIdentityType() {
115+
return identityType;
116+
}
117+
118+
public void setIdentityType(String identityType) {
119+
this.identityType = identityType;
120+
getPayeeinfo().put("identity_type", identityType);
121+
}
122+
123+
124+
/**
125+
* 参与方真实姓名
126+
*
127+
* @return 参与方真实姓名
128+
*/
129+
public String getName() {
130+
return getPayeeName();
131+
}
132+
133+
public void setName(String name) {
134+
setPayeeName(name);
135+
getPayeeinfo().put("name", name);
136+
}
137+
138+
/**
139+
* 转账业务请求的扩展参数,支持传入的扩展参数如下:
140+
* 1、sub_biz_scene 子业务场景,红包业务必传,取值REDPACKET,C2C现金红包、B2C现金红包均需传入;
141+
* <p>
142+
* 2、withdraw_timeliness为转账到银行卡的预期到账时间,可选(不传入则默认为T1),取值T0表示预期T+0到账,取值T1表示预期T+1到账,因到账时效受银行机构处理影响,支付宝无法保证一定是T0或者T1到账;
143+
*
144+
* @return 转账业务请求的扩展参数
145+
*/
146+
public String getBusinessParams() {
147+
return (String) getAttr("business_params");
148+
}
149+
150+
public void setBusinessParams(String businessParams) {
151+
addAttr("business_params", businessParams);
152+
}
153+
154+
155+
}

0 commit comments

Comments
 (0)