src/RefundContext.php
public function initRefund($channel, array $config)
    {
        try {
            switch ($channel) {
                case Config::ALI_REFUND:
                    $this->refund = new AliRefund($config);
                    break;
                case Config::WX_REFUND:
                    $this->refund = new WxRefund($config);
                    break;
                case Config::CMB_REFUND:
                    $this->refund = new CmbRefund($config);
                    break;
                default:
                    throw new PayException('当前仅支持：ALI WEIXIN CMB');
            }
        } catch (PayException $e) {
            throw $e;
        }
    }
public function initRefund($channel, array $config)
    {
        try {
            switch ($channel) {
                case Config::ALI_REFUND:
                    $this->refund = new AliRefund($config);
                    break;
                case Config::WX_REFUND:
                    $this->refund = new WxRefund($config);
                    break;
                case Config::CMB_REFUND:
                    $this->refund = new CmbRefund($config);
                    break;
                default:
                    throw new PayException('当前仅支持：ALI WEIXIN CMB');
            }
        } catch (PayException $e) {
            throw $e;
        }
    }
public function initRefund ( $ channel , array $ config ) { try { switch ( $ channel ) { case Config :: ALI_REFUND : $ this -> refund = new AliRefund ( $ config ) ; break ; case Config :: WX_REFUND : $ this -> refund = new WxRefund ( $ config ) ; break ; case Config :: CMB_REFUND : $ this -> refund = new CmbRefund ( $ config ) ; break ; default : throw new PayException ( '当前仅支持：ALI WEIXIN CMB'); } } catch ( PayException $ e ) { throw $ e ; } }
设置对应的退款渠道
@param string $channel 退款渠道
- @see Config

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