package co.yixiang.yshop.module.pay;

import co.yixiang.yshop.module.pay.controller.admin.merchantdetails.vo.PayParam;
import co.yixiang.yshop.module.pay.strategy.Pay;
import co.yixiang.yshop.module.pay.strategy.PayFactory;
import lombok.Getter;

import java.util.Map;

@Getter
public class PayContext {

    private Pay pay;

    public Map<String, String> selectPayWay(String payCode, PayParam payParam) throws Exception {
        pay = PayFactory.getInstance().create(payCode);
        return pay.selectPayWay(payCode, payParam);
    }

    public void setPay(Pay pay) {
        this.pay = pay;
    }
}


