package com.ghy.web.core;

import com.ghy.common.adapay.callback.PayCallback;
import com.ghy.common.adapay.model.PayReply;
import com.ghy.order.service.OrderDetailService;
import com.ghy.order.service.OrderMasterService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * 用户支付后
 */
@Configuration
public class AfterPay {

    @Resource
    OrderMasterService orderMasterService;
    @Resource
    OrderDetailService orderDetailService;

    @Bean
    public PayCallback payCallback() {
        return new PayCallback() {
            @Override
            public void onReply(PayReply reply) {
                // TODO 修改 OrderMaster 订单状态
                // TODO 修改 OrderDetail 订单状态
                // TODO 保存支付结果到MySQL
            }
        };
    }
}
