集成 封装处理
This commit is contained in:
@@ -2,6 +2,7 @@ package com.czg.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.PayAdapter;
|
||||
import com.czg.PayManager;
|
||||
import com.czg.constant.PayChannelCst;
|
||||
import com.czg.entity.resp.CzgBaseResp;
|
||||
import com.czg.entity.resp.CzgRefundResp;
|
||||
@@ -11,6 +12,7 @@ import com.czg.pay.CzgPayBaseReq;
|
||||
import com.czg.pay.CzgRefundReq;
|
||||
import com.czg.pay.NativeMerchantDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -38,15 +40,15 @@ public class NativePayAdapter implements PayAdapter {
|
||||
switch (payType) {
|
||||
// case H5_PAY:
|
||||
// return h5Pay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
// case JS_PAY:
|
||||
// return jsPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
// case LT_PAY:
|
||||
// return ltPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
case JS_PAY:
|
||||
return jsPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
case LT_PAY:
|
||||
return jsPay(polyMerchantDTO, notifyUrl, bizData);
|
||||
// case SCAN_PAY:
|
||||
// return scanPay(polyMerchantDTO, domain, notifyUrl, bizData);
|
||||
// case MICRO_PAY:
|
||||
// //扫码支付 扫描码
|
||||
// return microPay(polyMerchantDTO, domain, notifyUrl, (CzgPayBaseReq<String>) bizData);
|
||||
case MICRO_PAY:
|
||||
//扫码支付 扫描码
|
||||
return barPay(polyMerchantDTO, notifyUrl, (CzgPayBaseReq<String>) bizData);
|
||||
default:
|
||||
throw new CzgException("原生支付不支持该支付方式: " + bizData.getPayType());
|
||||
}
|
||||
@@ -70,4 +72,14 @@ public class NativePayAdapter implements PayAdapter {
|
||||
public CzgResult<CzgRefundResp> queryRefund(String domain, String payData, String mchRefundNo, String refundOrderId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> jsPay(NativeMerchantDTO merchantDTO, String notifyUrl, CzgPayBaseReq<?> bizData) {
|
||||
bizData.setNotifyUrl(notifyUrl);
|
||||
return CzgResult.success(PayManager.jsapiPay(bizData, merchantDTO));
|
||||
}
|
||||
|
||||
private CzgResult<Map<String, Object>> barPay(NativeMerchantDTO merchantDTO, String notifyUrl, CzgPayBaseReq<String> bizData) {
|
||||
bizData.setNotifyUrl(notifyUrl);
|
||||
return CzgResult.success(PayManager.barPay(bizData, merchantDTO));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user