package com.xingxi.api.service.impl;


import com.xingxi.common.service.XingxiUnifiedpayCallbackClient;
import com.xingxi.common.service.XingxiUnifiedpayCallbackDTO;
import com.xingxi.unifiedpay.domain.XingxiUnifiedpayCallbackResultDTO;
import com.xingxi.unifiedpay.open.XingxiUnifiedpayCallbackServiceI;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;


@Slf4j
@Component
@RequiredArgsConstructor
class XingxiUnifiedpayCallbackServiceImpl implements XingxiUnifiedpayCallbackServiceI {
    private final XingxiUnifiedpayCallbackClient xingxiUnifiedpayCallbackClient;

    @Override
    public void callbackFollowUpProcessing(XingxiUnifiedpayCallbackResultDTO xingxiUnifiedpayCallbackResultDTO) {
        XingxiUnifiedpayCallbackDTO xingxiUnifiedpayCallbackDTO = new XingxiUnifiedpayCallbackDTO();
        BeanUtils.copyProperties(xingxiUnifiedpayCallbackResultDTO, xingxiUnifiedpayCallbackDTO);
        xingxiUnifiedpayCallbackClient.execute(xingxiUnifiedpayCallbackDTO);
    }

}
