Commit 9673dc14 by ping.wu

礼品卡支付参数对接支付

parent 763ecb50
...@@ -72,4 +72,10 @@ public class CombPayRequest { ...@@ -72,4 +72,10 @@ public class CombPayRequest {
private String ver ="10"; private String ver ="10";
private String storeName; private String storeName;
private Long merchantDiscount; private Long merchantDiscount;
/**
* @see com.freemud
* 下单所用小程序类型:1微信,2支付宝,3抖音")
*/
private Integer applicationType;
} }
...@@ -4175,6 +4175,7 @@ public class OrderAdapter { ...@@ -4175,6 +4175,7 @@ public class OrderAdapter {
orderPayDto.setPlatforms(platforms); orderPayDto.setPlatforms(platforms);
orderPayDto.setOut_order_no(orderBean.getOid()); orderPayDto.setOut_order_no(orderBean.getOid());
orderPayDto.setCardCode(cardNo); orderPayDto.setCardCode(cardNo);
orderPayDto.setApplicationType(getPayApplicationType(orderBean.getOrderClient()));
return orderPayDto; return orderPayDto;
} }
...@@ -4623,4 +4624,25 @@ public class OrderAdapter { ...@@ -4623,4 +4624,25 @@ public class OrderAdapter {
return name; return name;
} }
/**
* 礼品卡支付参数转化
*/
public Integer getPayApplicationType(String orderClient) {
Integer applicationType = PayApplicationTypeEnum.WECHAT.getType();
switch (orderClient) {
case "2":
applicationType = PayApplicationTypeEnum.WECHAT.getType();
break;
case "3":
applicationType = PayApplicationTypeEnum.ALIPAY.getType();
break;
case "27":
applicationType = PayApplicationTypeEnum.BYTE_DANCE.getType();
break;
default:
break;
}
return applicationType;
}
} }
package cn.freemud.entities.dto.order; package cn.freemud.entities.dto.order;
import com.freemud.application.sdk.api.paymentcenter.client.request.CodePayRequest;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* All rights Reserved, Designed By www.freemud.cn * All rights Reserved, Designed By www.freemud.cn
* *
...@@ -32,6 +35,13 @@ public class FacePayRequestDto { ...@@ -32,6 +35,13 @@ public class FacePayRequestDto {
private Long clientCode; private Long clientCode;
private String code; private String code;
private Long undisAmount; private Long undisAmount;
// private List<CodePayRequest.PayProduct> products; private String payCode;
private String cardPassword;
private Long merchantDiscount;
//下单所用小程序类型:1微信,2支付宝,3抖音 礼品卡支付新增,记录渠道
private Integer applicationType;
private List<CodePayRequest.PayProduct> products;
} }
package cn.freemud.enums;
public enum PayApplicationTypeEnum {
WECHAT(1, "微信小程序"),
ALIPAY(2, "支付宝小程序"),
BYTE_DANCE(3, "抖音小程序"),
;
private int type;
private String desc;
PayApplicationTypeEnum() {
}
PayApplicationTypeEnum(Integer type, String desc) {
this.type = type;
this.desc = desc;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
...@@ -735,7 +735,7 @@ public class PayServiceImpl { ...@@ -735,7 +735,7 @@ public class PayServiceImpl {
* 纯储值卡或礼品卡支付 * 纯储值卡或礼品卡支付
*/ */
public OrderPayResponse svcPay(String cardCode, OrderBeanV1 orderBean, PaymentRequest paymentRequest, String transId, String trackingNo) { public OrderPayResponse svcPay(String cardCode, OrderBeanV1 orderBean, PaymentRequest paymentRequest, String transId, String trackingNo) {
CodePayRequest request = new CodePayRequest(); FacePayRequestDto request = new FacePayRequestDto();
OrderPayResponse orderPayResponse = new OrderPayResponse(); OrderPayResponse orderPayResponse = new OrderPayResponse();
String partnerId = orderBean.getCompanyId(); String partnerId = orderBean.getCompanyId();
request.setBody(orderBean.getShopName()); request.setBody(orderBean.getShopName());
...@@ -749,6 +749,7 @@ public class PayServiceImpl { ...@@ -749,6 +749,7 @@ public class PayServiceImpl {
request.setOperatorId("1"); request.setOperatorId("1");
request.setVer("2"); request.setVer("2");
request.setMerchantDiscount(orderBean.getOriginalAmount().longValue() - orderBean.getAmount()); request.setMerchantDiscount(orderBean.getOriginalAmount().longValue() - orderBean.getAmount());
request.setApplicationType(orderAdapter.getPayApplicationType(orderBean.getOrderClient()));
SVCCardAmountRequestDto svcRequest = new SVCCardAmountRequestDto(); SVCCardAmountRequestDto svcRequest = new SVCCardAmountRequestDto();
svcRequest.setPartnerId(partnerId); svcRequest.setPartnerId(partnerId);
svcRequest.setCardCodes(Arrays.asList(cardCode)); svcRequest.setCardCodes(Arrays.asList(cardCode));
...@@ -769,12 +770,13 @@ public class PayServiceImpl { ...@@ -769,12 +770,13 @@ public class PayServiceImpl {
return orderPayResponse; return orderPayResponse;
} }
//svc卡支付 //svc卡支付
com.freemud.application.sdk.api.base.BaseResponse<CodePayResponse> responseBase = paymentNewService.codePay(request, trackingNo); com.freemud.application.sdk.api.base.BaseResponse<FacePayResponseDto> responseBase = paymentNewClient.codePay(request);
if (responseBase == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode()) || responseBase.getData().getData() == null) { if (responseBase == null || !ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode())
|| responseBase.getData() == null || !Objects.equals(responseBase.getData().getResultCode(), ResponseCodeConstant.RESPONSE_SUCCESS)) {
// 1.9.34 预支付失败需要把原因进行记录 // 1.9.34 预支付失败需要把原因进行记录
orderPayResponse.setMsg(Objects.isNull(responseBase) ? "卡支付异常" : responseBase.getMessage()); orderPayResponse.setMsg(Objects.isNull(responseBase) ? "卡支付异常" : responseBase.getMessage());
} else { } else {
CodePayResponse.CodePayDate codePayResponse = responseBase.getData().getData(); FacePayResponseDto codePayResponse = responseBase.getData();
orderPayResponse.setFmId(codePayResponse.getFmId()); orderPayResponse.setFmId(codePayResponse.getFmId());
orderPayResponse.setPayTransId(codePayResponse.getPayTransId()); orderPayResponse.setPayTransId(codePayResponse.getPayTransId());
orderPayResponse.setWxAppid(paymentRequest.getWxAppId()); orderPayResponse.setWxAppid(paymentRequest.getWxAppId());
......
...@@ -58,4 +58,10 @@ public interface PaymentNewClient { ...@@ -58,4 +58,10 @@ public interface PaymentNewClient {
@PostMapping("paymentcenter/invoice/create") @PostMapping("paymentcenter/invoice/create")
com.freemud.application.sdk.api.base.BaseResponse<InvoiceCreateResponse> createInvoice(@RequestBody InvoiceCreateRequest request); com.freemud.application.sdk.api.base.BaseResponse<InvoiceCreateResponse> createInvoice(@RequestBody InvoiceCreateRequest request);
//线下付,储值卡/礼品卡支付
@LogIgnoreFeign(logMessage="codePay",statusCodeFieldName= ResponseCodeKeyConstant.STATUS_CODE)
@PostMapping("paymentcenter/codePay")
com.freemud.application.sdk.api.base.BaseResponse<FacePayResponseDto> codePay(@RequestBody FacePayRequestDto orderPayDto);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment