feat 分账SDK相关接口, 版本号升级

This commit is contained in:
DaxPay
2024-12-18 14:23:33 +08:00
parent b5d10f1ead
commit 0bfc0c6c97
65 changed files with 716 additions and 770 deletions

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.dromara.daxpay</groupId>
<artifactId>daxpay-single-channel</artifactId>
<version>3.0.0.beta2</version>
<version>3.0.0.beta3</version>
</parent>
<artifactId>daxpay-single-wechat</artifactId>

View File

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* 微信回调通知控制器
* @author xxm
* @since 2024/7/29
*/
@@ -44,7 +44,6 @@ public class WechatPayCallbackController {
return payCallbackService.payHandle(request);
}
@Operation(summary = "微信退款回调")
@PostMapping("/refund")
public String wechatRefundNotify(@PathVariable("AppId") String appId,HttpServletRequest request) {

View File

@@ -1,644 +0,0 @@
package org.dromara.daxpay.channel.wechat.result.pay;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
/**
* 微信V3付款码返回结果
* @author xxm
* @since 2024/7/24
*/
@Data
@Accessors(chain = true)
public class WxPayCodepayResult implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名应用ID
* 变量名appid
* 是否必填:是
* 类型string[1,32]
* 描述:
* 由微信生成的应用ID全局唯一。请求统一下单接口时请注意APPID的应用属性例如公众号场景下需使用应用属性为公众号的APPID
* 示例值wxd678efh567hg6787
* </pre>
*/
@SerializedName(value = "appid")
protected String appid;
/**
* <pre>
* 字段名:直连商户号
* 变量名mchid
* 是否必填:是
* 类型string[1,32]
* 描述:
* 直连商户的商户号,由微信支付生成并下发。
* 示例值1230000109
* </pre>
*/
@SerializedName(value = "mchid")
protected String mchid;
/**
* <pre>
* 字段名:商户订单号
* 变量名out_trade_no
* 是否必填:是
* 类型string[6,32]
* 描述:
* 商户系统内部订单号只能是数字、大小写字母_-*且在同一个商户号下唯一
* 示例值1217752501201407033233368018
* </pre>
*/
@SerializedName(value = "out_trade_no")
protected String outTradeNo;
/**
* <pre>
* 字段名:微信支付返回的订单号
* 变量名transaction_id
* 是否必填:是
* 类型string32
* 描述:
* 微信分配的公众账号ID
* 示例值1000320306201511078440737890
* </pre>
*/
@SerializedName(value = "transaction_id")
private String transactionId;
/**
* <pre>
* 字段名:交易类型
* 变量名trade_type
* 是否必填:是
* 类型string[1,16]
* 描述:
* 枚举值:
* NATIVE扫码支付
* JSAPI公众号支付
* APPAPP支付
* MWEBH5支付
* 示例值: JSAPI
* </pre>
*/
@SerializedName(value = "trade_type")
private String tradeType;
/**
* <pre>
* 字段名:付款银行
* 变量名bank_type
* 是否必填:否
* 类型string16
* 描述:
* 银行类型,采用字符串类型的银行标识。
* 示例值CMC
* </pre>
*/
@SerializedName(value = "bank_type")
private String bankType;
/**
* <pre>
* 字段名:支付完成时间
* 变量名success_time
* 是否必填:否
* 类型string64
* 描述支付完成时间遵循rfc3339标准格式格式为YYYY-MM-DDTHH:mm:ss+TIMEZONEYYYY-MM-DD表示年月日T出现在字符串中表示time元素的开头HH:mm:ss表示时分秒TIMEZONE表示时区+08:00表示东八区时间领先UTC 8小时即北京时间。例如2015-05-20T13:29:35+08:00表示北京时间2015年5月20日 13点29分35秒。
* 示例值2018-06-08T10:34:56+08:00
* </pre>
*/
@SerializedName(value = "success_time")
private String successTime;
/**
* <pre>
* 字段名:交易状态
* 变量名trade_state
* 是否必填:是
* 类型string[1,32]
* 描述:
* 交易状态,枚举值:
* SUCCESS支付成功
* REFUND转入退款
* NOTPAY未支付
* REVOKED已撤销付款码支付
* USERPAYING用户支付中付款码支付
* PAYERROR支付失败(其他原因,如银行返回失败)
* 示例值SUCCESS
* </pre>
*/
@SerializedName(value = "trade_state")
private String tradeState;
/**
* <pre>
* 字段名:交易状态描述
* 变量名trade_state_desc
* 是否必填:是
* 类型string256
* 描述:交易状态描述
* 示例值:支付失败,请重新下单支付
* </pre>
*/
@SerializedName(value = "trade_state_desc")
private String tradeStateDesc;
/**
* <pre>
* 字段名:附加数据
* 变量名attach
* 是否必填:否
* 类型string[1,128]
* 描述:
* 附加数据在查询API和支付通知中原样返回可作为自定义参数使用
* 示例值:自定义数据
* </pre>
*/
@SerializedName(value = "attach")
protected String attach;
/**
* <pre>
* 字段名:订单优惠标记
* 变量名goods_tag
* 是否必填:否
* 类型string[1,256]
* 描述:
* 订单优惠标记
* 示例值WXG
* </pre>
*/
@SerializedName(value = "goods_tag")
private String goodsTag;
/**
* <pre>
* 字段名:电子发票入口开放标识
* 变量名support_fapiao
* 是否必填:否
* 类型boolean
* 描述传入true时支付成功消息和支付详情页将出现开票入口。需要在微信支付商户平台或微信公众平台开通电子发票功能传此字段才可生效。
* </pre>
*/
@SerializedName(value = "support_fapiao")
private Boolean supportFapiao;
/**
* <pre>
* 字段名:支付者
* 变量名payer
* 是否必填:是
* 类型object
* 描述:
* 支付者信息
* </pre>
*/
@SerializedName(value = "payer")
private Payer payer;
/**
* <pre>
* 字段名:订单金额
* 变量名amount
* 是否必填:是
* 类型object
* 描述:
* 订单金额信息
* </pre>
*/
@SerializedName(value = "amount")
private Amount amount;
/**
* <pre>
* 字段名:场景信息
* 变量名scene_info
* 是否必填:否
* 类型object
* 描述:
* 支付场景描述
* </pre>
*/
@SerializedName(value = "scene_info")
private SceneInfo sceneInfo;
/**
* <pre>
* 字段名:优惠功能
* 变量名promotion_detail
* 是否必填:否
* 类型array
* 描述:
* 优惠功能,享受优惠时返回该字段。
* </pre>
*/
@SerializedName(value = "promotion_detail")
private List<PromotionDetail> promotionDetails;
@Data
@NoArgsConstructor
public static class Amount implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名:总金额
* 变量名total
* 是否必填:否
* 类型int
* 描述:
* 订单总金额,单位为分。
* 示例值100
* </pre>
*/
@SerializedName(value = "total")
private Integer total;
/**
* <pre>
* 字段名:用户支付金额
* 变量名payer_total
* 是否必填:否
* 类型int
* 描述:
* 用户支付金额,单位为分。
* 示例值100
* </pre>
*/
@SerializedName(value = "payer_total")
private Integer payerTotal;
/**
* <pre>
* 字段名:货币类型
* 变量名currency
* 是否必填:否
* 类型string[1,16]
* 描述:
* CNY人民币境内商户号仅支持人民币。
* 示例值CNY
* </pre>
*/
@SerializedName(value = "currency")
private String currency;
/**
* <pre>
* 字段名:用户支付币种
* 变量名payer_currency
* 是否必填:否
* 类型string[1,16]
* 描述:
* 用户支付币种
* 示例值: CNY
* </pre>
*/
@SerializedName(value = "payer_currency")
private String payerCurrency;
}
@Data
@NoArgsConstructor
public static class Payer implements Serializable {
@Serial
private static final long serialVersionUID = -1L;
/**
* <pre>
* 字段名:用户标识
* 变量名auth_code
* 是否必填:是
* 类型string[32]
* 描述:
* 付款码支付授权码,即用户打开微信钱包显示的码。
* 示例值130061098828009406
* </pre>
*/
@SerializedName(value = "auth_code")
private String authCode;
}
@Data
@NoArgsConstructor
public static class SceneInfo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名:商户端设备 IP
* 变量名device_ip
* 是否必填:是
* 类型string[1,45]
* 描述:
* 用户的客户端IP支持IPv4和IPv6两种格式的IP地址。
* 示例值14.23.150.211
* </pre>
*/
@SerializedName(value = "device_ip")
private String deviceIp;
/**
* <pre>
* 字段名:商户端设备号
* 变量名device_id
* 是否必填:否
* 类型string[1,32]
* 描述:
* 商户端设备号门店号或收银设备ID
* 示例值013467007045764
* </pre>
*/
@SerializedName(value = "device_id")
private String deviceId;
/**
* <pre>
* 字段名:商户门店信息
* 变量名store_info
* 是否必填:否
* 类型object
* 描述:
* 商户门店信息
* </pre>
*/
@SerializedName(value = "store_info")
private StoreInfo storeInfo;
}
/**
* 商户门店信息
*/
@Data
@NoArgsConstructor
public static class StoreInfo implements Serializable {
@Serial
private static final long serialVersionUID = -1L;
/**
* <pre>
* 字段名:门店编号
* 变量名id
* 是否必填:是
* 类型string[1,32]
* 描述:
* 此参数与商家自定义编码(out_id)二选一必填。
* 微信支付线下场所ID格式为纯数字。
* 基于合规要求与风险管理目的,线下条码支付时需传入用户实际付款的场景信息。
* 指引参见https://kf.qq.com/faq/230817neeaem2308177ZFfqM.html。
* 示例值0001
* </pre>
*/
@SerializedName(value = "id")
private String id;
/**
* <pre>
* 字段名:商家自定义编码
* 变量名out_id
* 是否必填:否
* 类型string[1,256]
* 描述:
* 此参数与门店(id)二选一必填。
* 商户系统的门店编码支持大小写英文字母、数字仅支持utf-8格式。
* 基于合规要求与风险管理目的,线下条码支付时需传入用户实际付款的场景信息。
* 示例值A1111
* </pre>
*/
@SerializedName(value = "out_id")
private String outId;
}
@Data
@NoArgsConstructor
public static class SettleInfo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名:是否指定分账
* 变量名profit_sharing
* 是否必填:否
* 类型boolean
* 描述:
* 是否指定分账
* 示例值false
* </pre>
*/
@SerializedName(value = "profit_sharing")
private Boolean profitSharing;
}
@Data
@NoArgsConstructor
public static class PromotionDetail implements Serializable {
/**
* <pre>
* 字段名券ID
* 变量名coupon_id
* 是否必填:是
* 类型string[1,32]
* 描述:
* 券ID
* 示例值109519
* </pre>
*/
@SerializedName(value = "coupon_id")
private String couponId;
/**
* <pre>
* 字段名:优惠名称
* 变量名name
* 是否必填:否
* 类型string[1,64]
* 描述:
* 优惠名称
* 示例值:单品惠-6
* </pre>
*/
@SerializedName(value = "name")
private String name;
/**
* <pre>
* 字段名:优惠范围
* 变量名scope
* 是否必填:否
* 类型string[1,32]
* 描述:
* GLOBAL全场代金券
* SINGLE单品优惠
* 示例值GLOBAL
* </pre>
*/
@SerializedName(value = "scope")
private String scope;
/**
* <pre>
* 字段名:优惠类型
* 变量名type
* 是否必填:否
* 类型string[1,32]
* 描述:
* CASH充值
* NOCASH预充值
* 示例值CASH
* </pre>
*/
@SerializedName(value = "type")
private String type;
/**
* <pre>
* 字段名:优惠券面额
* 变量名amount
* 是否必填:是
* 类型int
* 描述:
* 优惠券面额
* 示例值100
* </pre>
*/
@SerializedName(value = "amount")
private Integer amount;
/**
* <pre>
* 字段名活动ID
* 变量名stock_id
* 是否必填:否
* 类型string[1,32]
* 描述:
* 活动ID
* 示例值931386
* </pre>
*/
@SerializedName(value = "stock_id")
private String stockId;
/**
* <pre>
* 字段名:微信出资
* 变量名wechatpay_contribute
* 是否必填:否
* 类型int
* 描述:
* 微信出资,单位为分
* 示例值0
* </pre>
*/
@SerializedName(value = "wechatpay_contribute")
private Integer wechatpayContribute;
/**
* <pre>
* 字段名:商户出资
* 变量名merchant_contribute
* 是否必填:否
* 类型int
* 描述:
* 商户出资,单位为分
* 示例值0
* </pre>
*/
@SerializedName(value = "merchant_contribute")
private Integer merchantContribute;
/**
* <pre>
* 字段名:其他出资
* 变量名other_contribute
* 是否必填:否
* 类型int
* 描述:
* 其他出资,单位为分
* 示例值0
* </pre>
*/
@SerializedName(value = "other_contribute")
private Integer otherContribute;
/**
* <pre>
* 字段名:优惠币种
* 变量名currency
* 是否必填:否
* 类型string[1,16]
* 描述:
* CNY人民币境内商户号仅支持人民币。
* 示例值CNY
* </pre>
*/
@SerializedName(value = "currency")
private String currency;
/**
* <pre>
* 字段名:单品列表
* 变量名goods_detail
* 是否必填:否
* 类型array
* 描述:
* 单品列表信息
* </pre>
*/
@SerializedName(value = "goods_detail")
private List<GoodsDetail> goodsDetails;
}
@Data
@NoArgsConstructor
public static class GoodsDetail implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名:商品编码
* 变量名goods_id
* 是否必填:是
* 类型string[1,32]
* 描述:
* 商品编码
* 示例值M1006
* </pre>
*/
@SerializedName(value = "goods_id")
private String goodsId;
/**
* <pre>
* 字段名:商品数量
* 变量名quantity
* 是否必填:是
* 类型int
* 描述:
* 用户购买的数量
* 示例值1
* </pre>
*/
@SerializedName(value = "quantity")
private Integer quantity;
/**
* <pre>
* 字段名:商品单价
* 变量名unit_price
* 是否必填:是
* 类型int
* 描述:
* 商品单价,单位为分
* 示例值100
* </pre>
*/
@SerializedName(value = "unit_price")
private Integer unitPrice;
/**
* <pre>
* 字段名:商品优惠金额
* 变量名discount_amount
* 是否必填:是
* 类型int
* 描述:
* 商品优惠金额
* 示例值0
* </pre>
*/
@SerializedName(value = "discount_amount")
private Integer discountAmount;
/**
* <pre>
* 字段名:商品备注
* 变量名goods_remark
* 是否必填:否
* 类型string[1,128]
* 描述:
* 商品备注信息
* 示例值:商品备注信息
* </pre>
*/
@SerializedName(value = "goods_remark")
private String goodsRemark;
}
}

View File

@@ -1,54 +0,0 @@
package org.dromara.daxpay.channel.wechat.result.pay;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 微信V3撤销支付订单返回结果
* @author xxm
* @since 2024/7/24
*/
@Data
@Accessors(chain = true)
public class WxPayOrderReverseV3Result {
/**
* <pre>
* 字段名应用ID
* 变量名appid
* 是否必填:是
* 类型string[1,32]
* 描述:
* 由微信生成的应用ID全局唯一。请求统一下单接口时请注意APPID的应用属性例如公众号场景下需使用应用属性为公众号的APPID
* 示例值wxd678efh567hg6787
* </pre>
*/
@SerializedName(value = "appid")
protected String appid;
/**
* <pre>
* 字段名:直连商户号
* 变量名mchid
* 是否必填:是
* 类型string[1,32]
* 描述:
* 直连商户的商户号,由微信支付生成并下发。
* 示例值1230000109
* </pre>
*/
@SerializedName(value = "mchid")
protected String mchid;
/**
* <pre>
* 字段名:商户订单号
* 变量名out_trade_no
* 是否必填:是
* 类型string[6,32]
* 描述:
* 商户系统内部订单号只能是数字、大小写字母_-*且在同一个商户号下唯一
* 示例值1217752501201407033233368018
* </pre>
*/
@SerializedName(value = "out_trade_no")
protected String outTradeNo;
}