src/RedContext.php
public function initRed($channel, array $config)
    {
        try {
            switch ($channel) {
                case Config::ALI_RED:
                    $this->red = new AliRed($config);
                    break;
                case Config::WX_RED:
                    $this->red = new WxRed($config);
                    break;
                default:
                    throw new PayException('当前仅支持：ALI WEIXIN两个常量');
            }
        } catch (PayException $e) {
            throw $e;
        }
    }
public function initRed($channel, array $config)
    {
        try {
            switch ($channel) {
                case Config::ALI_RED:
                    $this->red = new AliRed($config);
                    break;
                case Config::WX_RED:
                    $this->red = new WxRed($config);
                    break;
                default:
                    throw new PayException('当前仅支持：ALI WEIXIN两个常量');
            }
        } catch (PayException $e) {
            throw $e;
        }
    }
public function initRed ( $ channel , array $ config ) { try { switch ( $ channel ) { case Config :: ALI_RED : $ this -> red = new AliRed ( $ config ) ; break ; case Config :: WX_RED : $ this -> red = new WxRed ( $ config ) ; break ; default : throw new PayException ( '当前仅支持：ALI WEIXIN两个常量'); } } catch ( PayException $ e ) { throw $ e ; } }
设置对应的发送渠道
@param string $channel 退款渠道
- @see Config

@param array $config 配置文件
@throws PayException
@author IT
设置对应的发送渠道 @param string $channel 退款渠道 - @see Config