package com.bonus.core.pay.custom;

import cn.hutool.core.collection.CollUtil;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayRequest;
import com.alipay.api.AlipayResponse;
import com.bonus.core.common.custom.business.CustomBusiness;
import com.bonus.core.pay.channel.ali.api.AlipayAPI;
import com.bonus.core.pay.channel.ali.service.AliPayServiceImpl;
import com.bonus.core.pay.common.dto.AndroidPayDTO;
import com.bonus.core.pay.common.dto.MobilePayDTO;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayCustomAlipayBusiness implements CustomBusiness {
   public String name() {
      return "支付-支付宝";
   }

   public List<CustomBusiness.Version> versions() {
      return CollUtil.newArrayList(new CustomBusiness.Version[]{CustomBusiness.Version.of("5.5.4", "初版")});
   }

   public <T extends AlipayResponse> void beforeAppPay(AlipayRequest<T> request, MobilePayDTO mobilePayDTO) {
   }

   public <T extends AlipayResponse> void beforeAppletPay(AlipayRequest<T> request, MobilePayDTO mobilePayDTO) {
   }

   public <T extends AlipayResponse> void beforeFacePay(AlipayRequest<T> request, AndroidPayDTO androidPayDTO) {
   }

   public <T extends AlipayResponse> void beforeHoldingPay(AlipayRequest<T> request, AlipayAPI.HoldingParam param) {
   }

   public <T extends AlipayResponse> void beforeEnterpriseCodePay(AlipayRequest<T> request, AlipayAPI.EnterpriseCodeAliParam param, Long canteenId) {
   }

   public <T extends AlipayResponse> void beforeEnterpriseCodeFacePay(AlipayRequest<T> request, AndroidPayDTO androidPayDTO) {
   }

   public AlipayClient didCreateClient(Long canteenId, Integer payType, AlipayClient alipayClient) {
      return alipayClient;
   }

   public <T extends AlipayResponse> T willExecute(AliPayServiceImpl.PayClient payClient, AlipayRequest<T> request, boolean sdk) throws AlipayApiException {
      return null;
   }
}
