支付相关配置

This commit is contained in:
2023-02-28 13:44:20 +08:00
parent 3e2140a30c
commit 5e8cc8f83a
5 changed files with 79 additions and 19 deletions

View File

@@ -20,12 +20,12 @@ import com.zscat.mallplus.oms.service.IOmsOrderService;
import com.zscat.mallplus.oms.vo.OmsUpdateStatusParam;
import com.zscat.mallplus.util.UserUtils;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.InterfaceUrl;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -33,6 +33,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.security.PublicKey;
import java.util.List;
/**
@@ -54,6 +55,26 @@ public class OmsOrderReturnApplyController {
@Resource
private IOmsOrderService IOmsOrderService;
@Value("${alipay.domain}")
private String DOMAIN;
@Value("${alipay.appId}")
private String APPID;
@Value("${alipay.privateKey}")
private String APP_PRIVATE_KEY;
/**
* 支付宝公钥
*/
@Value("${alipay.ALIPAY_PUBLIC_KEY}")
private String ALIPAY_PUBLIC_KEY;
/**
* 支付宝网关
*/
@Value("${alipay.serverUrl}")
private String GATE;
@SysLog(MODULE = "oms", REMARK = "根据条件查询所有订单退货申请列表")
@ApiOperation("根据条件查询所有订单退货申请列表")
@GetMapping(value = "/list")
@@ -193,7 +214,8 @@ public class OmsOrderReturnApplyController {
*/
public String queryPayment(String Out_Trade_No) {
//填写自己创建的app的对应参数
AlipayClient alipayClient = new DefaultAlipayClient(InterfaceUrl.serverUrl, InterfaceUrl.appId, InterfaceUrl.privateKey, "json", "utf-8", InterfaceUrl.publicKey, "RSA2");
// AlipayClient alipayClient = new DefaultAlipayClient(InterfaceUrl.serverUrl, InterfaceUrl.appId, InterfaceUrl.privateKey, "json", "utf-8", InterfaceUrl.publicKey, "RSA2");
AlipayClient alipayClient = new DefaultAlipayClient(GATE, APPID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2");
AlipayTradeQueryRequest alipay_request = new AlipayTradeQueryRequest();
AlipayTradeQueryModel model = new AlipayTradeQueryModel();
@@ -221,7 +243,8 @@ public class OmsOrderReturnApplyController {
* @return
*/
public String alipayRefund(String out_trade_no, String trade_no, String refund_amount) {
AlipayClient alipayClient = new DefaultAlipayClient(InterfaceUrl.serverUrl, InterfaceUrl.appId, InterfaceUrl.privateKey, "json", "utf-8", InterfaceUrl.publicKey, "RSA2");
// AlipayClient alipayClient = new DefaultAlipayClient(InterfaceUrl.serverUrl, InterfaceUrl.appId, InterfaceUrl.privateKey, "json", "utf-8", InterfaceUrl.publicKey, "RSA2");
AlipayClient alipayClient = new DefaultAlipayClient(GATE, APPID, APP_PRIVATE_KEY, "json", "utf-8", ALIPAY_PUBLIC_KEY, "RSA2");
//订单编号 支付宝交易号不为空
if (out_trade_no != null && trade_no != null) {
AlipayTradeRefundRequest alipay_request = new AlipayTradeRefundRequest();