package com.liquidnet.service.dragon.channel.strategy.impl;

import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.dragon.biz.DragonServiceCommonBiz;
import com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz;
import com.liquidnet.service.dragon.channel.alipay.strategy.AlipayStrategyContext;
import com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler;
import com.liquidnet.service.dragon.channel.strategy.biz.DragonPayBiz;
import com.liquidnet.service.dragon.constant.DragonConstant;
import com.liquidnet.service.dragon.dto.DragonOrdersDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseReqDto;
import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import com.liquidnet.service.dragon.dto.DragonPayOrderQueryRespDto;
import com.liquidnet.service.dragon.service.impl.DragonOrderRefundsServiceImpl;
import com.liquidnet.service.dragon.utils.DataUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;

/**
 * @author AnJiabin <anjiabin@zhengzai.tv>
 * @version V1.0
 * @Description: TODO
 * @class: PayChannelStrategyAlipayImpl
 * @Package com.liquidnet.service.dragon.channel.strategy.impl
 * @Copyright: LightNet @ Copyright (c) 2021
 * @date 2021/7/13 13:06
 */
@Slf4j
@Component
@StrategyPayChannelHandler(DragonConstant.PayChannelEnum.ALIPAY)
public class ApplepayImpl extends AbstractPayChannelStrategyImpl {
    @Autowired
    private AlipayStrategyContext alipayStrategyContext;

    @Autowired
    private DataUtils dataUtils;

    @Autowired
    private AlipayBiz alipayBiz;

    @Autowired
    private DragonPayBiz dragonPayBiz;

    @Autowired
    private DragonServiceCommonBiz dragonServiceCommonBiz;

    @Autowired
    private DragonOrderRefundsServiceImpl dragonOrderRefundsService;

    @Value("${liquidnet.dragon.alipay.appId}")
    private String appId;
    @Value("${liquidnet.dragon.alipay.merchantPubKey}")
    private String merchantPubKey;
    @Value("${liquidnet.dragon.alipay.merchantPrivateKey}")
    private String merchantPrivateKey;
    @Value("${liquidnet.dragon.alipay.signtType}")
    private String signtType;
    @Value("${liquidnet.dragon.alipay.charset}")
    private String charset;


    public void completeSuccessOrder(DragonOrdersDto dragonOrdersDto,String code,String result){
        this.completeSuccessOrderNoNotify(dragonOrdersDto, code, LocalDateTime.now(), result);
    }

    @Override
    public ResponseDto<DragonPayBaseRespDto> dragonPay(DragonPayBaseReqDto dragonPayBaseReqDto) {
        return null;
    }

    @Override
    public String dragonNotify(HttpServletRequest request, String payType, String deviceFrom) {
        return null;
    }

    @Override
    public DragonPayOrderQueryRespDto checkOrderStatus(String code) {
        return null;
    }
}
