src/Notify/CmbNotify.php
protected function getRetData(array $data)
    {
        $noticeData = $data['noticeData'];
        $noticeType = $noticeData['noticeType'];
        if ($noticeType === CmbConfig::NOTICE_PAY) {
            $channel = Config::CMB_CHARGE;
        } elseif ($noticeType === CmbConfig::NOTICE_SIGN) {
            $channel = Config::CMB_BIND;
        } else {
            $channel = 'other';
        }

        if ($this->config->returnRaw) {
            $data['channel'] = $channel;
            return $data;
        } elseif ($noticeType === CmbConfig::NOTICE_PAY) {
            $retData = [
                'amount'   => $noticeData['amount'],
                'channel'   => $channel,
                'date' => $noticeData['date'],
                'order_no'   => $noticeData['orderNo'],
                'trade_state'   => Config::TRADE_STATUS_SUCC,// 招商的订单只会成功
                'transaction_id'   => $noticeData['bankSerialNo'],
                'time_end'   => date('Y-m-d H:i:s', strtotime($noticeData['dateTime'])),// Y-m-d H:i:s
                'discount_fee' => $noticeData['discountAmount'],// 优惠金额,格式：xxxx.xx  无优惠时返回0.00
                'card_type' => $noticeData['cardType'],// 卡类型,02：一卡通；03：信用卡；07：他行卡
                'return_param' => $noticeData['merchantPara'],
                'discount_flag' => $noticeData['discountFlag'],
                'notice_no' => $noticeData['noticeSerialNo'],
            ];
        } elseif ($noticeType === CmbConfig::NOTICE_SIGN) {
            $retData = [
                'user_id' => $noticeData['userID'],
                'no_pwd_pay' => $noticeData['noPwdPay'],
                'notice_no' => $noticeData['noticeSerialNo'],
                'agr_no' => $noticeData['agrNo'],
                'rsp_msg' => $noticeData['rspMsg'],
                'return_param' => $noticeData['noticePara'],
                'user_pid_hash' => $noticeData['userPidHash'],
                'user_pid_type' => $noticeData['userPidType'],
                'channel'   => $channel,
            ];
        } else {
            $retData = $noticeData;
        }

        return $retData;
    }
protected function getRetData(array $data)
    {
        $noticeData = $data['noticeData'];
        $noticeType = $noticeData['noticeType'];
        if ($noticeType === CmbConfig::NOTICE_PAY) {
            $channel = Config::CMB_CHARGE;
        } elseif ($noticeType === CmbConfig::NOTICE_SIGN) {
            $channel = Config::CMB_BIND;
        } else {
            $channel = 'other';
        }

        if ($this->config->returnRaw) {
            $data['channel'] = $channel;
            return $data;
        } elseif ($noticeType === CmbConfig::NOTICE_PAY) {
            $retData = [
                'amount'   => $noticeData['amount'],
                'channel'   => $channel,
                'date' => $noticeData['date'],
                'order_no'   => $noticeData['orderNo'],
                'trade_state'   => Config::TRADE_STATUS_SUCC,// 招商的订单只会成功
                'transaction_id'   => $noticeData['bankSerialNo'],
                'time_end'   => date('Y-m-d H:i:s', strtotime($noticeData['dateTime'])),// Y-m-d H:i:s
                'discount_fee' => $noticeData['discountAmount'],// 优惠金额,格式：xxxx.xx  无优惠时返回0.00
                'card_type' => $noticeData['cardType'],// 卡类型,02：一卡通；03：信用卡；07：他行卡
                'return_param' => $noticeData['merchantPara'],
                'discount_flag' => $noticeData['discountFlag'],
                'notice_no' => $noticeData['noticeSerialNo'],
            ];
        } elseif ($noticeType === CmbConfig::NOTICE_SIGN) {
            $retData = [
                'user_id' => $noticeData['userID'],
                'no_pwd_pay' => $noticeData['noPwdPay'],
                'notice_no' => $noticeData['noticeSerialNo'],
                'agr_no' => $noticeData['agrNo'],
                'rsp_msg' => $noticeData['rspMsg'],
                'return_param' => $noticeData['noticePara'],
                'user_pid_hash' => $noticeData['userPidHash'],
                'user_pid_type' => $noticeData['userPidType'],
                'channel'   => $channel,
            ];
        } else {
            $retData = $noticeData;
        }

        return $retData;
    }
protected function getRetData ( array $ data ) { $ noticeData = $ data [ 'noticeData' ] ; $ noticeType = $ noticeData [ 'noticeType' ] ; if ( $ noticeType === CmbConfig :: NOTICE_PAY ) { $ channel = Config :: CMB_CHARGE ; } elseif ( $ noticeType === CmbConfig :: NOTICE_SIGN ) { $ channel = Config :: CMB_BIND ; } else { $ channel = 'other' ; } if ( $ this -> config -> returnRaw ) { $ data [ 'channel' ] = $ channel ; return $ data ; } elseif ( $ noticeType === CmbConfig :: NOTICE_PAY ) { $ retData = [ 'amount' => $ noticeData [ 'amount' ] , 'channel' => $ channel , 'date' => $ noticeData [ 'date' ] , 'order_no' => $ noticeData [ 'orderNo' ] , 'trade_state' => Config :: TRADE_STATUS_SUCC , // 招商的订单只会成功 'transaction_id' => $ noticeData [ 'bankSerialNo' ] , 'time_end' => date ( 'Y-m-d H:i:s' , strtotime ( $ noticeData [ 'dateTime' ] ) ) , // Y-m-d H:i:s 'discount_fee' => $ noticeData [ 'discountAmount' ] , // 优惠金额,格式：xxxx.xx  无优惠时返回0.00 'card_type' => $ noticeData [ 'cardType' ] , // 卡类型,02：一卡通；03：信用卡；07：他行卡 'return_param' => $ noticeData [ 'merchantPara' ] , 'discount_flag' => $ noticeData [ 'discountFlag' ] , 'notice_no' => $ noticeData [ 'noticeSerialNo' ] , ] ; } elseif ( $ noticeType === CmbConfig :: NOTICE_SIGN ) { $ retData = [ 'user_id' => $ noticeData [ 'userID' ] , 'no_pwd_pay' => $ noticeData [ 'noPwdPay' ] , 'notice_no' => $ noticeData [ 'noticeSerialNo' ] , 'agr_no' => $ noticeData [ 'agrNo' ] , 'rsp_msg' => $ noticeData [ 'rspMsg' ] , 'return_param' => $ noticeData [ 'noticePara' ] , 'user_pid_hash' => $ noticeData [ 'userPidHash' ] , 'user_pid_type' => $ noticeData [ 'userPidType' ] , 'channel' => $ channel , ] ; } else { $ retData = $ noticeData ; } return $ retData ; }
向客户端返回相关数据
@param array $data
@return array
向客户端返回相关数据