package com.softwarebr.nunu.service.pay.ali.impl;

import com.softwarebr.nunu.service.pay.PaymentService;
import com.softwarebr.nunu.service.pay.ali.AliPayNotifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 支付通知
 *
 * @author xu
 * @date 2019/11/1 17:11
 */
@Service
@Slf4j
public class AliPayNotifyServiceImpl implements AliPayNotifyService {

    @Autowired
    PaymentService paymentService;

    @Override
    public void tradeSuccess(String outTradeNo, String buyerId, String buyerPayAmount) {
        paymentService.paySuccess(outTradeNo);
        log.info("tradeSuccess(outTradeNo={}, buyerId={})");
    }

    @Override
    public void tradeClose(String outTradeNo) {
        log.info("tradeClose(outTradeNo={})", outTradeNo);
    }
}
