package co.yixiang.yshop.module.pay.strategy.type;

import co.yixiang.yshop.module.pay.controller.admin.merchantdetails.vo.PayParam;
import co.yixiang.yshop.module.pay.strategy.PayClient;
import co.yixiang.yshop.module.pay.strategy.weixin.service.WxPayServiceUtils;

import javax.annotation.Resource;
import java.util.Map;

public class WeChatPay implements PayClient {

    @Resource
    private WxPayServiceUtils wxPayServiceUtils;

    public WeChatPay() {
    }

    public WeChatPay(WxPayServiceUtils wxPayServiceUtils) {
        this.wxPayServiceUtils = wxPayServiceUtils;
    }

    @Override
    public Map<String, String> payment(PayParam param) throws Exception {
        // 支付
        return wxPayServiceUtils.gotoPay(param);
    }
}
