对接支付开发
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import com.ruoyi.dto.PayRequest;
|
||||
|
||||
public interface ICasePaymentService {
|
||||
String casePay(PayRequest request);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import com.ruoyi.ElegentPay;
|
||||
import com.ruoyi.constant.Platform;
|
||||
import com.ruoyi.constant.TradeType;
|
||||
import com.ruoyi.dto.PayRequest;
|
||||
import com.ruoyi.dto.PayResponse;
|
||||
import com.ruoyi.system.service.ICasePaymentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class CasePaymentServiceImpl implements ICasePaymentService {
|
||||
private final ElegentPay elegentPay;
|
||||
@Autowired
|
||||
public CasePaymentServiceImpl(ElegentPay elegentPay){
|
||||
this.elegentPay=elegentPay;
|
||||
}
|
||||
@Override
|
||||
public String casePay(PayRequest request) {
|
||||
PayResponse payResponse = elegentPay.requestPay(request, TradeType.NATIVE, Platform.WX);
|
||||
if (payResponse!=null){
|
||||
return payResponse.getCode_url();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user