常量
This commit is contained in:
@@ -79,9 +79,27 @@ public interface ParamCodeCst {
|
|||||||
* 超掌柜支付回调地址
|
* 超掌柜支付回调地址
|
||||||
* <p>支付宝/微信支付完成后,支付平台回调我方系统的地址</p>
|
* <p>支付宝/微信支付完成后,支付平台回调我方系统的地址</p>
|
||||||
*/
|
*/
|
||||||
// public static String PAY_CZG_NOTIFY_URL = "pay_czg_notify_url";
|
|
||||||
public static String NATIVE_PAY_NOTIFY_URL = "native_pay_notify_url";
|
public static String NATIVE_PAY_NOTIFY_URL = "native_pay_notify_url";
|
||||||
|
public static String NATIVE_REFUND_NOTIFY_URL = "native_refund_notify_url";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 超掌柜支付域名
|
||||||
|
* <p>超掌柜支付相关接口的根域名</p>
|
||||||
|
*/
|
||||||
|
public static String POLY_DOMAIN = "poly_domain";
|
||||||
public static String POLY_PAY_NOTIFY_URL = "poly_pay_notify_url";
|
public static String POLY_PAY_NOTIFY_URL = "poly_pay_notify_url";
|
||||||
|
public static String POLY_REFUND_NOTIFY_URL = "poly_refund_notify_url";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信原生回调地址
|
||||||
|
* <p>微信原生支付接口的回调地址(区别于超掌柜封装的回调)</p>
|
||||||
|
*/
|
||||||
|
public static String NATIVE_NOTIFY_URL = "native_notify_url";
|
||||||
|
/**
|
||||||
|
* 店铺订单支付BaseUrl
|
||||||
|
* <p>店铺订单支付页面的基础域名</p>
|
||||||
|
*/
|
||||||
|
public static String SHOP_ORDER_PAY_BASE_URL = "shop_order_pay_base_url";
|
||||||
/**
|
/**
|
||||||
* 排队到号通知
|
* 排队到号通知
|
||||||
*/
|
*/
|
||||||
@@ -113,11 +131,6 @@ public interface ParamCodeCst {
|
|||||||
*/
|
*/
|
||||||
public static String SMS_FEE = "sms_fee";
|
public static String SMS_FEE = "sms_fee";
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺订单支付BaseUrl
|
|
||||||
* <p>店铺订单支付页面的基础域名</p>
|
|
||||||
*/
|
|
||||||
public static String SHOP_ORDER_PAY_BASE_URL = "shop_order_pay_base_url";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台名称
|
* 平台名称
|
||||||
@@ -125,30 +138,12 @@ public interface ParamCodeCst {
|
|||||||
*/
|
*/
|
||||||
public static String PLATE_NAME = "plate_name";
|
public static String PLATE_NAME = "plate_name";
|
||||||
|
|
||||||
/**
|
|
||||||
* 超掌柜退款回调地址
|
|
||||||
* <p>支付平台处理退款后,回调我方系统的地址</p>
|
|
||||||
*/
|
|
||||||
public static String PAY_CZG_REFUND_NOTIFY_URL = "pay_czg_refund_notify_url";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 超掌柜支付域名
|
|
||||||
* <p>超掌柜支付相关接口的根域名</p>
|
|
||||||
*/
|
|
||||||
public static String PAY_CZG_DOMAIN = "pay_czg_domain";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 叫号页面地址
|
* 叫号页面地址
|
||||||
* <p>餐厅叫号系统的前端页面地址</p>
|
* <p>餐厅叫号系统的前端页面地址</p>
|
||||||
*/
|
*/
|
||||||
public static String CALL_PAGE_URL = "call_page_url";
|
public static String CALL_PAGE_URL = "call_page_url";
|
||||||
|
|
||||||
/**
|
|
||||||
* 微信原生回调地址
|
|
||||||
* <p>微信原生支付接口的回调地址(区别于超掌柜封装的回调)</p>
|
|
||||||
*/
|
|
||||||
public static String NATIVE_NOTIFY_URL = "native_notify_url";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公众号关注位置
|
* 公众号关注位置
|
||||||
* <p>公众号关注入口的展示位置,可选值:mine-我的页面、order-订单页面、eat-就餐页面</p>
|
* <p>公众号关注入口的展示位置,可选值:mine-我的页面、order-订单页面、eat-就餐页面</p>
|
||||||
|
|||||||
@@ -91,11 +91,12 @@ public class PayServiceImpl implements PayService {
|
|||||||
String payData = null;
|
String payData = null;
|
||||||
if (shopMerchant.getChannel().equals(PayChannelCst.NATIVE)) {
|
if (shopMerchant.getChannel().equals(PayChannelCst.NATIVE)) {
|
||||||
payData = shopMerchant.getNativePayJson();
|
payData = shopMerchant.getNativePayJson();
|
||||||
|
bizData.setNotifyUrl(sysParamsService.getSysParamValue(ParamCodeCst.System.NATIVE_REFUND_NOTIFY_URL));
|
||||||
} else if (shopMerchant.getChannel().equals(PayChannelCst.POLY)) {
|
} else if (shopMerchant.getChannel().equals(PayChannelCst.POLY)) {
|
||||||
payData = shopMerchant.getPolyPayJson();
|
payData = shopMerchant.getPolyPayJson();
|
||||||
|
bizData.setNotifyUrl(sysParamsService.getSysParamValue(ParamCodeCst.System.POLY_REFUND_NOTIFY_URL));
|
||||||
}
|
}
|
||||||
// bizData.setNotifyUrl(sysParamsService.getSysParamValue(ParamCodeCst.System.PAY_CZG_REFUND_NOTIFY_URL));
|
return adapter.refund(getDomain(), payData, bizData);
|
||||||
return adapter.refund(getDomain(), payData, "", bizData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -199,7 +200,7 @@ public class PayServiceImpl implements PayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getDomain() {
|
private String getDomain() {
|
||||||
return sysParamsService.getSysParamValue(ParamCodeCst.System.PAY_CZG_DOMAIN);
|
return sysParamsService.getSysParamValue(ParamCodeCst.System.POLY_DOMAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getNotifyUrl(String channel) {
|
private String getNotifyUrl(String channel) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public interface PayAdapter {
|
|||||||
CzgResult<Map<String, Object>> pay(@NonNull CzgPayEnum payType, @NotBlank String payData, @NotBlank String domain,
|
CzgResult<Map<String, Object>> pay(@NonNull CzgPayEnum payType, @NotBlank String payData, @NotBlank String domain,
|
||||||
@NotBlank String notifyUrl, CzgPayBaseReq bizData);
|
@NotBlank String notifyUrl, CzgPayBaseReq bizData);
|
||||||
|
|
||||||
CzgResult<RefundRespDTO> refund(@NotBlank String domain, @NotBlank String payData, String notifyUrl, CzgRefundReq bizData);
|
CzgResult<RefundRespDTO> refund(@NotBlank String domain, @NotBlank String payData, CzgRefundReq bizData);
|
||||||
|
|
||||||
CzgResult<QueryOrderRespDTO> queryPayOrder(@NotBlank String domain, @NotBlank String payData, String payOrderId, String mchOrderNo, String platform);
|
CzgResult<QueryOrderRespDTO> queryPayOrder(@NotBlank String domain, @NotBlank String payData, String payOrderId, String mchOrderNo, String platform);
|
||||||
|
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ public class NativePayAdapter implements PayAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CzgResult<RefundRespDTO> refund(String domain, String payData, String notifyUrl, CzgRefundReq bizData) {
|
public CzgResult<RefundRespDTO> refund(String domain, String payData, CzgRefundReq bizData) {
|
||||||
NativeMerchantDTO merchantDTO = getMerchantDTO(payData);
|
NativeMerchantDTO merchantDTO = getMerchantDTO(payData);
|
||||||
return CzgResult.success(PayManager.refund(bizData, notifyUrl, merchantDTO));
|
return CzgResult.success(PayManager.refund(bizData, bizData.getNotifyUrl(), merchantDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ public class PolyPayAdapter implements PayAdapter {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CzgResult<RefundRespDTO> refund(@NotBlank String domain, @NotBlank String payData, String notifyUrl, CzgRefundReq bizData) {
|
public CzgResult<RefundRespDTO> refund(@NotBlank String domain, @NotBlank String payData, CzgRefundReq bizData) {
|
||||||
PolyMerchantDTO shopMerchant = JSONObject.parseObject(payData, PolyMerchantDTO.class);
|
PolyMerchantDTO shopMerchant = JSONObject.parseObject(payData, PolyMerchantDTO.class);
|
||||||
bizData.setNotifyUrl(notifyUrl);
|
|
||||||
CzgResult<CzgRefundResp> result = PolyPayUtils.refundOrder(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), bizData);
|
CzgResult<CzgRefundResp> result = PolyPayUtils.refundOrder(domain, shopMerchant.getAppId(), shopMerchant.getAppSecret(), bizData);
|
||||||
return convertRefundResp(result);
|
return convertRefundResp(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user