Commit 38fabf89 by xiangkun.gu

提供创建订单需要使用的接口

parent 4632b593
package cn.freemud.controller;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.entities.vo.PutDeadLetterVo;
import cn.freemud.service.impl.PayServiceImpl;
import cn.freemud.utils.ResponseUtil;
import com.freemud.application.sdk.api.log.ApiAnnotation;
import com.freemud.application.sdk.api.log.LogParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 暴露订单相关的业务接口,提供给applet项目
*/
@RestController
@RequestMapping("/exposure")
public class ExposureOrderController {
@Autowired
private PayServiceImpl payService;
/**
* 创建支付单,查询支付配置
*/
@ApiAnnotation(logMessage = "创建支付单,查询支付配置")
@GetMapping("/getPayConfig")
public BaseResponse<String> getPayConfig(@LogParams @RequestParam("partnerId") String partnerId, @RequestParam("appId") String appId) {
String payConfig = payService.getPayConfig(partnerId, appId);
return ResponseUtil.success(payConfig);
}
/**
* 创建支付单,查询超时时间
*/
@ApiAnnotation(logMessage = "创建支付单,查询超时时间")
@GetMapping("/getPayTimeout")
public BaseResponse<String> getPayTimeout(@LogParams @RequestParam("partnerId") String partnerId) {
String partnerPayOvertime = payService.getPartnerPayOvertime(partnerId);
return ResponseUtil.success(partnerPayOvertime);
}
/**
* 创建支付单,查询payCode
*/
@ApiAnnotation(logMessage = "创建支付单,查询payCode")
@GetMapping("/getPayCodeByChanel")
public BaseResponse<String> getPayCodeByChanel(@LogParams @RequestParam("appId") String appId,
@RequestParam("storeId") String storeId,
@RequestParam(value = "channel", required = false) String channel) {
String payCodeByCondition = payService.getPayCodeByCondition(appId, storeId, channel);
return ResponseUtil.success(payCodeByCondition);
}
/**
* 创建订单,死信队列
*/
@ApiAnnotation(logMessage = "创建订单,死信队列")
@PostMapping("/deadLetterQueue")
public BaseResponse deadLetterQueue(@LogParams @RequestBody PutDeadLetterVo putDeadLetterVo) {
payService.putDelMq(putDeadLetterVo.getPartnerId(), putDeadLetterVo.getStoreId(), putDeadLetterVo.getFmId(), putDeadLetterVo.getOrderId(), putDeadLetterVo.getPayChanelType());
return ResponseUtil.success();
}
}
package cn.freemud.entities.vo;
import lombok.Data;
@Data
public class PutDeadLetterVo {
private String partnerId;
private String storeId;
private String fmId;
private String orderId;
private Integer payChanelType;
}
...@@ -468,6 +468,10 @@ public class PayServiceImpl { ...@@ -468,6 +468,10 @@ public class PayServiceImpl {
return principalName; return principalName;
} }
public String getPayConfig(String partnerId, String appId) {
return this.getPaymentPrincipalName(partnerId, appId);
}
/** /**
* 电子风味卡支付 * 电子风味卡支付
...@@ -1135,6 +1139,14 @@ public class PayServiceImpl { ...@@ -1135,6 +1139,14 @@ public class PayServiceImpl {
return ""; return "";
} }
public String getPayCodeByCondition(String wxAppid, String storeId, String channel) {
if (channel != null) {
return this.getPayCodeByChanel(wxAppid, channel, storeId);
}
return this.getPayCodeByChanel(wxAppid, storeId);
}
/** /**
* 获取混合支付是否开启 * 获取混合支付是否开启
......
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