mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 18:46:29 +00:00
feat(checkout): 支持聚合支付条码支付
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara.daxpay.channel.alipay.strategy;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AliPayCheckoutStrategy extends AbsCheckoutStrategy {
|
||||
|
||||
/**
|
||||
* 策略标识, 可以自行进行扩展
|
||||
*
|
||||
@@ -24,4 +26,13 @@ public class AliPayCheckoutStrategy extends AbsCheckoutStrategy {
|
||||
public String getChannel() {
|
||||
return ChannelEnum.ALI.getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测付款码
|
||||
*/
|
||||
@Override
|
||||
public boolean checkBarCode(String barCode){
|
||||
String[] ali = { "25", "26", "27", "28", "29", "30" };
|
||||
return StrUtil.startWithAny(barCode.substring(0, 2), ali);
|
||||
}
|
||||
}
|
||||
|
@@ -45,6 +45,14 @@ public class WechatCheckoutStrategy extends AbsCheckoutStrategy {
|
||||
return wechatAuthService.generateInnerAuthUrl(redirectUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测付款码
|
||||
*/
|
||||
@Override
|
||||
public boolean checkBarCode(String barCode){
|
||||
String[] wx = { "10", "11", "12", "13", "14", "15" };
|
||||
return StrUtil.startWithAny(barCode.substring(0, 2), wx);
|
||||
}
|
||||
/**
|
||||
* 获取认证结果
|
||||
*/
|
||||
|
Reference in New Issue
Block a user