mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 02:34:34 +00:00
feat 演示示例支持分账, 微信分账签名错误修复
This commit is contained in:
@@ -21,6 +21,9 @@ public class AggregatePayInfo {
|
||||
@Schema(description = "订单业务号")
|
||||
private String businessNo;
|
||||
|
||||
@Schema(description = "是否分账")
|
||||
private boolean allocation;
|
||||
|
||||
/** 支付金额 */
|
||||
@Schema(description = "支付金额")
|
||||
private Integer amount;
|
||||
|
@@ -20,6 +20,9 @@ public class AggregateSimplePayParam {
|
||||
@NotNull
|
||||
private String businessNo;
|
||||
|
||||
@Schema(description = "是否分账")
|
||||
private boolean allocation;
|
||||
|
||||
@Schema(description = "标题")
|
||||
@NotNull
|
||||
private String title;
|
||||
|
@@ -22,6 +22,9 @@ public class CashierSimplePayParam {
|
||||
@NotNull
|
||||
private String businessNo;
|
||||
|
||||
@Schema(description = "是否分账")
|
||||
private boolean allocation;
|
||||
|
||||
@Schema(description = "标题")
|
||||
@NotNull
|
||||
private String title;
|
||||
|
@@ -58,6 +58,7 @@ public class AggregateService {
|
||||
AggregatePayInfo aggregatePayInfo = new AggregatePayInfo()
|
||||
.setTitle(param.getTitle())
|
||||
.setBusinessNo(param.getBusinessNo())
|
||||
.setAllocation(param.isAllocation())
|
||||
.setAmount(amount);
|
||||
String code = IdUtil.getSnowflakeNextIdStr();
|
||||
String serverUrl = daxPayDemoProperties.getServerUrl();
|
||||
@@ -218,6 +219,7 @@ public class AggregateService {
|
||||
|
||||
SimplePayParam simplePayParam = new SimplePayParam();
|
||||
simplePayParam.setBusinessNo(param.getBusinessNo());
|
||||
simplePayParam.setAllocation(param.isAllocation());
|
||||
simplePayParam.setTitle(param.getTitle());
|
||||
simplePayParam.setAmount(amount);
|
||||
simplePayParam.setChannel(payChannel.getCode());
|
||||
|
@@ -52,6 +52,7 @@ public class CashierService {
|
||||
// 将参数转换为简单支付参数
|
||||
SimplePayParam simplePayParam = new SimplePayParam();
|
||||
simplePayParam.setBusinessNo(param.getBusinessNo());
|
||||
simplePayParam.setAllocation(param.isAllocation());
|
||||
int amount = param.getAmount()
|
||||
.multiply(BigDecimal.valueOf(100))
|
||||
.intValue();
|
||||
|
@@ -96,9 +96,9 @@ public class WeChatPayAllocationService {
|
||||
* 查询分账状态
|
||||
*/
|
||||
public void queryStatus(AllocationOrder allocationOrder, WeChatPayConfig config){
|
||||
// 不要传输AppId参数, 否则会失败
|
||||
Map<String, String> params = ProfitSharingModel.builder()
|
||||
.mch_id(config.getWxMchId())
|
||||
.appid(config.getWxAppId())
|
||||
.nonce_str(WxPayKit.generateStr())
|
||||
.transaction_id(allocationOrder.getGatewayPayOrderNo())
|
||||
.out_order_no(allocationOrder.getOrderNo())
|
||||
|
Reference in New Issue
Block a user