Skip to content

Commit 17a446e

Browse files
committed
增加几个支付相关的常量
1 parent 1e7cb4d commit 17a446e

File tree

2 files changed

+156
-3
lines changed

2 files changed

+156
-3
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayRefundRequest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.binarywang.wxpay.bean.request;
22

33
import com.github.binarywang.wxpay.config.WxPayConfig;
4+
import com.github.binarywang.wxpay.constant.WxPayConstants.RefundAccountSource;
45
import com.github.binarywang.wxpay.exception.WxPayException;
56
import com.thoughtworks.xstream.annotations.XStreamAlias;
67
import lombok.*;
@@ -32,8 +33,10 @@
3233
@AllArgsConstructor
3334
@XStreamAlias("xml")
3435
public class WxPayRefundRequest extends WxPayBaseRequest {
35-
private static final String[] REFUND_ACCOUNT = new String[]{"REFUND_SOURCE_RECHARGE_FUNDS",
36-
"REFUND_SOURCE_UNSETTLED_FUNDS"};
36+
private static final String[] REFUND_ACCOUNT = new String[]{
37+
RefundAccountSource.RECHARGE_FUNDS,
38+
RefundAccountSource.UNSETTLED_FUNDS
39+
};
3740
/**
3841
* <pre>
3942
* 设备号

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java

Lines changed: 151 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public static class SignType {
9898
public static final String MD5 = "MD5";
9999
}
100100

101-
102101
/**
103102
* 限定支付方式
104103
*/
@@ -123,4 +122,155 @@ public static class ResultCode {
123122
*/
124123
public static final String FAIL = "FAIL";
125124
}
125+
126+
/**
127+
* 退款资金来源
128+
*/
129+
public static class RefundAccountSource {
130+
/**
131+
* 可用余额退款/基本账户
132+
*/
133+
public static final String RECHARGE_FUNDS = "REFUND_SOURCE_RECHARGE_FUNDS";
134+
135+
/**
136+
* 未结算资金退款
137+
*/
138+
public static final String UNSETTLED_FUNDS = "REFUND_SOURCE_UNSETTLED_FUNDS";
139+
140+
}
141+
142+
/**
143+
* 退款渠道
144+
*/
145+
public static class RefundChannel {
146+
/**
147+
* 原路退款
148+
*/
149+
public static final String ORIGINAL = "ORIGINAL";
150+
151+
/**
152+
* 退回到余额
153+
*/
154+
public static final String BALANCE = "BALANCE";
155+
156+
/**
157+
* 原账户异常退到其他余额账户
158+
*/
159+
public static final String OTHER_BALANCE = "OTHER_BALANCE";
160+
161+
/**
162+
* 原银行卡异常退到其他银行卡
163+
*/
164+
public static final String OTHER_BANKCARD = "OTHER_BANKCARD";
165+
}
166+
167+
/**
168+
* 交易状态
169+
*/
170+
public static class WxpayTradeStatus {
171+
/**
172+
* 支付成功
173+
*/
174+
public static final String SUCCESS = "SUCCESS";
175+
176+
/**
177+
* 支付失败(其他原因,如银行返回失败)
178+
*/
179+
public static final String PAY_ERROR = "PAYERROR";
180+
181+
/**
182+
* 用户支付中
183+
*/
184+
public static final String USER_PAYING = "USERPAYING";
185+
186+
/**
187+
* 已关闭
188+
*/
189+
public static final String CLOSED = "CLOSED";
190+
191+
/**
192+
* 未支付
193+
*/
194+
public static final String NOTPAY = "NOTPAY";
195+
196+
/**
197+
* 转入退款
198+
*/
199+
public static final String REFUND = "REFUND";
200+
201+
/**
202+
* 已撤销(刷卡支付)
203+
*/
204+
public static final String REVOKED = "REVOKED";
205+
}
206+
207+
/**
208+
* 退款状态
209+
*/
210+
public static class RefundStatus {
211+
/**
212+
* 退款成功
213+
*/
214+
public static final String SUCCESS = "SUCCESS";
215+
216+
/**
217+
* 退款关闭
218+
*/
219+
public static final String REFUND_CLOSE = "REFUNDCLOSE";
220+
221+
/**
222+
* 退款处理中
223+
*/
224+
public static final String PROCESSING = "PROCESSING";
225+
226+
/**
227+
* 退款异常,退款到银行发现用户的卡作废或者冻结了,导致原路退款银行卡失败,可前往商户平台(pay.weixin.qq.com)-交易中心,手动处理此笔退款。
228+
*/
229+
public static final String CHANGE = "CHANGE";
230+
}
231+
232+
/**
233+
* 关闭订单结果错误代码
234+
*/
235+
public static class OrderCloseResultErrorCode {
236+
/**
237+
* 订单已支付
238+
*/
239+
public static final String ORDER_PAID = "ORDERPAID";
240+
241+
/**
242+
* 系统错误
243+
*/
244+
public static final String SYSTEM_ERROR = "SYSTEMERROR";
245+
246+
/**
247+
* 订单不存在
248+
*/
249+
public static final String ORDER_NOT_EXIST = "ORDERNOTEXIST";
250+
251+
/**
252+
* 订单已关闭
253+
*/
254+
public static final String ORDER_CLOSED = "ORDERCLOSED";
255+
256+
/**
257+
* 签名错误
258+
*/
259+
public static final String SIGN_ERROR = "SIGNERROR";
260+
261+
/**
262+
* 未使用POST传递参数
263+
*/
264+
public static final String REQUIRE_POST_METHOD = "REQUIRE_POST_METHOD";
265+
266+
/**
267+
* XML格式错误
268+
*/
269+
public static final String XML_FORMAT_ERROR = "XML_FORMAT_ERROR";
270+
271+
/**
272+
* 订单状态错误
273+
*/
274+
public static final String TRADE_STATE_ERROR = "TRADE_STATE_ERROR";
275+
}
126276
}

0 commit comments

Comments
 (0)