src/NotifyContext.php
public function initNotify($channel, array $config)
    {
        try {
            switch ($channel) {
                case Config::ALI_CHARGE:
                    $this->notify = new AliNotify($config);
                    break;
                case Config::WX_CHARGE:
                    $this->notify = new WxNotify($config);
                    break;
                case Config::CMB_CHARGE:
                    $this->notify = new CmbNotify($config);
                    break;
                default:
                    throw new PayException('当前仅支持：ALI_CHARGE WX_CHARGE CMB_CHARGE 常量');
            }
        } catch (PayException $e) {
            throw $e;
        }
    }
public function initNotify($channel, array $config)
    {
        try {
            switch ($channel) {
                case Config::ALI_CHARGE:
                    $this->notify = new AliNotify($config);
                    break;
                case Config::WX_CHARGE:
                    $this->notify = new WxNotify($config);
                    break;
                case Config::CMB_CHARGE:
                    $this->notify = new CmbNotify($config);
                    break;
                default:
                    throw new PayException('当前仅支持：ALI_CHARGE WX_CHARGE CMB_CHARGE 常量');
            }
        } catch (PayException $e) {
            throw $e;
        }
    }
public function initNotify ( $ channel , array $ config ) { try { switch ( $ channel ) { case Config :: ALI_CHARGE : $ this -> notify = new AliNotify ( $ config ) ; break ; case Config :: WX_CHARGE : $ this -> notify = new WxNotify ( $ config ) ; break ; case Config :: CMB_CHARGE : $ this -> notify = new CmbNotify ( $ config ) ; break ; default : throw new PayException ( '当前仅支持：ALI_CHARGE WX_CHARGE CMB_CHARGE 常量'); } } catch ( PayException $ e ) { throw $ e ; } }
设置对应的通知渠道
@param string $channel 通知渠道
- @see Config

@param array $config 配置文件
@throws PayException
@author helei
设置对应的通知渠道 @param string $channel 通知渠道 - @see Config