|
@@ -76,12 +76,6 @@ public class AliPayService extends PayBaseService {
|
|
|
@Autowired
|
|
|
private PayMerchantService payMerchantService;
|
|
|
|
|
|
- /**
|
|
|
- * 支付调起
|
|
|
- *
|
|
|
- * @param product : 商品参数
|
|
|
- * @return : 返回调起支付参数
|
|
|
- */
|
|
|
@Override
|
|
|
public ResultMap create(ProductPayParamBO product) {
|
|
|
this.attach = product.getAttach();
|
|
@@ -94,23 +88,16 @@ public class AliPayService extends PayBaseService {
|
|
|
//不同的支付途径
|
|
|
switch (payDevice) {
|
|
|
case 1:
|
|
|
- return this.pc(product);
|
|
|
+ return this.pcPay(product);
|
|
|
case 2:
|
|
|
return this.h5Pay(product);
|
|
|
case 3:
|
|
|
- return this.app(product);
|
|
|
+ return this.appPay(product);
|
|
|
default:
|
|
|
throw new RuntimeException("未知支付方式");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 异步回调
|
|
|
- *
|
|
|
- * @param request : 请求参数
|
|
|
- * @param response : 返回参数
|
|
|
- * @return : 返回结果
|
|
|
- */
|
|
|
@Override
|
|
|
public String notify(HttpServletRequest request, HttpServletResponse response) {
|
|
|
try {
|
|
@@ -140,12 +127,6 @@ public class AliPayService extends PayBaseService {
|
|
|
return HttpStatusEnum.FAIL.getMsg();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 同步回调
|
|
|
- *
|
|
|
- * @param request : 请求参数
|
|
|
- * @return : 返回结果
|
|
|
- */
|
|
|
@Override
|
|
|
public ResultMap synNotify(HttpServletRequest request) {
|
|
|
try {
|
|
@@ -188,12 +169,6 @@ public class AliPayService extends PayBaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * h5支付
|
|
|
- *
|
|
|
- * @param product : 商品参数
|
|
|
- * @return : 返回支付调起参数
|
|
|
- */
|
|
|
private ResultMap h5Pay(ProductPayParamBO product) {
|
|
|
try {
|
|
|
AlipayTradeWapPayResponse response = Factory.Payment
|
|
@@ -208,7 +183,8 @@ public class AliPayService extends PayBaseService {
|
|
|
String body = response.getBody();
|
|
|
result.put("fromData", body);
|
|
|
//安卓与ios系统时才单独获取app支付地址
|
|
|
- if (!product.getDeviceSystem().contains(OsEnum.SYSTEM_ANDROID.getOs()) && !product.getDeviceSystem().contains(OsEnum.SYSTEM_IOS.getOs())) {
|
|
|
+ if (!product.getDeviceSystem().contains(OsEnum.SYSTEM_ANDROID.getOs())
|
|
|
+ && !product.getDeviceSystem().contains(OsEnum.SYSTEM_IOS.getOs())) {
|
|
|
return ResultMap.ok(product.getPayDevice(), result, product.getOutTradeNo());
|
|
|
}
|
|
|
Matcher matcher = pattern.matcher(body);
|
|
@@ -248,13 +224,7 @@ public class AliPayService extends PayBaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * pc端电脑支付
|
|
|
- *
|
|
|
- * @param product : 商品参数
|
|
|
- * @return : 返回支付调起参数
|
|
|
- */
|
|
|
- private ResultMap pc(ProductPayParamBO product) {
|
|
|
+ private ResultMap pcPay(ProductPayParamBO product) {
|
|
|
try {
|
|
|
log.info("pc端支付生成,请求参数 bo:{}", product);
|
|
|
AlipayTradePagePayResponse response = Factory.Payment
|
|
@@ -272,13 +242,7 @@ public class AliPayService extends PayBaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * app支付
|
|
|
- *
|
|
|
- * @param product : 商品参数
|
|
|
- * @return : 返回支付调起参数
|
|
|
- */
|
|
|
- private ResultMap app(ProductPayParamBO product) {
|
|
|
+ private ResultMap appPay(ProductPayParamBO product) {
|
|
|
try {
|
|
|
AlipayTradeAppPayResponse response = Factory.Payment
|
|
|
.App().asyncNotify(notifyUrl)
|
|
@@ -295,11 +259,6 @@ public class AliPayService extends PayBaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 配置初始化
|
|
|
- *
|
|
|
- * @param gamePayWayDTO : 游戏支付配置信息
|
|
|
- */
|
|
|
private void configInit(GamePayWayDTO gamePayWayDTO) {
|
|
|
//商户信息
|
|
|
PayMerchantDTO payMerchantDTO = payMerchantService.getByMerchantNo(gamePayWayDTO.getMerchantNo());
|