Przeglądaj źródła

支付宝接口调整

master
huminghao 1 miesiąc temu
rodzic
commit
ccddad1bad

+ 7
- 0
zhywpt-app-settlew/src/main/java/cn/com/taiji/settlew/dto/issueOrder/IssueOrderRefundResultRequestDTO.java Wyświetl plik

@@ -2,6 +2,7 @@ package cn.com.taiji.settlew.dto.issueOrder;

import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO;
import cn.com.taiji.core.entity.dict.issue.BankType;
import cn.com.taiji.core.entity.dict.issue.RefundOperateType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -30,6 +31,12 @@ public class IssueOrderRefundResultRequestDTO extends AbstractStaffBizRequestDTO
@NotBlank
private String censorResult;

@ApiModelProperty(value = "付款银行")
private BankType paymentBankType;

@ApiModelProperty(value = "付款银行卡号")
private String paymentBankCardId;

@ApiModelProperty(value = "重新审核原因")
private String failReason;


+ 10
- 1
zhywpt-app-settlew/src/main/java/cn/com/taiji/settlew/manager/issueOrder/IssueOrderRefundManagerImpl.java Wyświetl plik

@@ -79,8 +79,17 @@ public class IssueOrderRefundManagerImpl extends AbstractSettlewManager implemen
if (RefundOperateType.ORIGINAL.equals(orderRefund.getOperateType())){
//发起退费申请
orderFoundApply(orderRefund);
orderRefund.setStatus(RefundStatus.APPLY);
}else if (RefundOperateType.BANK.equals(orderRefund.getOperateType())){
if (dto.getPaymentBankType() == null){
throw new ManagerException("银行卡退费时付费银行必填!");
}
if (StringUtils.isEmpty(dto.getPaymentBankCardId())){
throw new ManagerException("银行卡退费时付费银行卡号必填!");
}
//todo 银行卡退费处理
}
orderRefund.setStatus(RefundStatus.APPLY);
}else if("重新审核".equals(dto.getCensorResult())){
orderRefund.setStatus(RefundStatus.FAILREFUND);
orderRefund.setFailReason(dto.getFailReason());

+ 0
- 22
zhywpt-service-ats/src/main/java/cn/com/taiji/ats/config/AliConfig.java Wyświetl plik

@@ -1,22 +0,0 @@
package cn.com.taiji.ats.config;

import com.alipay.api.AlipayConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliConfig {

@Bean
public AlipayConfig alipayConfig(String privateKey, String publicKey, String appId) {
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
alipayConfig.setAppId(appId);
alipayConfig.setPrivateKey(privateKey);//请填写您的应用私钥,例如:MIIEvQIBADANB...
alipayConfig.setFormat("json");
alipayConfig.setAlipayPublicKey(publicKey);//请填写您的支付宝公钥,例如:MIIBIjANBg...
alipayConfig.setCharset("UTF-8");
alipayConfig.setSignType("RSA2");
return alipayConfig;
}
}

+ 16
- 10
zhywpt-service-ats/src/main/java/cn/com/taiji/ats/manager/ali/AliCreatePayOrderManager.java Wyświetl plik

@@ -1,6 +1,5 @@
package cn.com.taiji.ats.manager.ali;

import cn.com.taiji.ats.config.AliConfig;
import cn.com.taiji.ats.manager.AbstractCommManager;
import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.core.model.comm.protocol.ats.ali.AtsAliOrderApplyRequest;
@@ -20,7 +19,6 @@ import com.alipay.api.response.AlipayTradeCreateResponse;
import com.alipay.api.response.AlipayTradePagePayResponse;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.alipay.api.response.AlipayTradeWapPayResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@@ -35,10 +33,6 @@ import org.springframework.util.StringUtils;
@Service
public class AliCreatePayOrderManager extends AbstractCommManager {

@Autowired
private AliConfig aliConfig;


public AtsAliOrderApplyResponse serviceHandle(AtsAliOrderApplyRequest request) throws ServiceHandleException {
switch (request.getTradeType()) {
case NATIVE:
@@ -57,9 +51,21 @@ public class AliCreatePayOrderManager extends AbstractCommManager {
}
}

private AlipayConfig alipayConfig(String privateKey, String publicKey, String appId) {
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
alipayConfig.setAppId(appId);
alipayConfig.setPrivateKey(privateKey);//请填写您的应用私钥,例如:MIIEvQIBADANB...
alipayConfig.setFormat("json");
alipayConfig.setAlipayPublicKey(publicKey);//请填写您的支付宝公钥,例如:MIIBIjANBg...
alipayConfig.setCharset("UTF-8");
alipayConfig.setSignType("RSA2");
return alipayConfig;
}


private AtsAliOrderApplyResponse nativeOrderApply(AtsAliOrderApplyRequest request) throws ServiceHandleException {
AlipayConfig alipayConfig = aliConfig.alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
AlipayConfig alipayConfig = alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
// 初始化SDK
AlipayClient alipayClient = null;
try {
@@ -97,7 +103,7 @@ public class AliCreatePayOrderManager extends AbstractCommManager {


private AtsAliOrderApplyResponse pwebOrderApply(AtsAliOrderApplyRequest request) throws ServiceHandleException {
AlipayConfig alipayConfig = aliConfig.alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
AlipayConfig alipayConfig = alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
// 初始化SDK
AlipayClient alipayClient = null;
try {
@@ -136,7 +142,7 @@ public class AliCreatePayOrderManager extends AbstractCommManager {


private AtsAliOrderApplyResponse jsapiOrderApply(AtsAliOrderApplyRequest request) throws ServiceHandleException {
AlipayConfig alipayConfig = aliConfig.alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
AlipayConfig alipayConfig = alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
// 初始化SDK
AlipayClient alipayClient = null;
try {
@@ -183,7 +189,7 @@ public class AliCreatePayOrderManager extends AbstractCommManager {
}

private AtsAliOrderApplyResponse mwebOrderApply(AtsAliOrderApplyRequest request) throws ServiceHandleException {
AlipayConfig alipayConfig = aliConfig.alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
AlipayConfig alipayConfig = alipayConfig(request.getPrivateKey(), request.getPublicKey(), request.getAppid());
// 初始化SDK
AlipayClient alipayClient = null;
try {

Ładowanie…
Anuluj
Zapisz