<?php

return [
    'user_model'   => \App\Models\User::class,
    //是否调试
    'debug'        => false,
    //环境变量
    'this_type'    => 'dev',
    //添加日志
    'log'          => true,
    //对账单信息
    'check'        => [
        'sftpadapter' => [
            'host'          => env('UNION_HOST', ''), //地址
            'port'          => env('UNION_PORT', 22), //端口
            'username'      => env('UNION_USERNAME', 'root'), //账号
            'password'      => env('UNION_PASSWORD', ''), //密码
            'privateKey'    => '',
            'passphrase'    => '',
            'root'          => env('UNION_ROOT', '/'), //路径
            'timeout'       => 10, //超时时间
            'directoryPerm' => 0755,
        ],
        'type'        => 'JYMX',
        'file_type'   => 'txt',
    ],
    //获取微信侧的优惠券
    'unionpay_url' => [
        'test' => [
            'code' => 'http://dev.spserv.yxlm.chinaums.com:25941/spapigateway/v2/markting/sp/coupon/order/get',
        ],
        'dev'  => [
            'code' => 'https://mktos.chinaums.com/spapigateway/v2/markting/sp/coupon/order/get',
        ],
    ],
    //不进行sign校验
    'nosign'       => [
        //        '002025',//查询
        //        '002100',//核销
        //        '002101',//冲正
        //        '002102',//撤销
        'openid', //获取openid 封装数据
        'code', //微信测获取优惠券
    ],
    //分配的渠道号
    'msg_sender'   => '660134',
    //打印在小票上，由活动标题、优惠金额、原始金额组合而成
    'pos_receipt'  => '本时生活，优惠生活',
    //广告，用于打印在小票上
    'pos_ad'       => '',
    //营销联盟广告，用于打印在小票上
    'pos_mkt_ad'   => '本时生活，优惠生活',
    //银联渠道id
    'agent_id'     => '299',
    //银联网点id
    'outlet_id'    => '2009300919918',
    //用于银商与sp分润的金额(是佣金的一部分), 以分为单位
    'serv_chg'     => 0,
    //佣金
    'commission'   => 0,
    //证书
    'certificate'  => [
        'dev' => [
            'ysd'   => [
                'private' => storage_path('cert/unionpay/dev/ysd/private_rsa.pem'),
                'public'  => storage_path('cert/unionpay/dev/ysd/public_rsa.pem'),
            ],
            'union' => [
                'public' => storage_path('cert/unionpay/dev/union/public_rsa.pem'),
            ],
        ],

        'test' => [
            'ysd'   => [
                'private' => storage_path('cert/unionpay/test/ysd/private_rsa.pem'),
                'public'  => storage_path('cert/unionpay/test/ysd/public_rsa.pem'),
            ],
            'union' => [
                'public' => storage_path('cert/unionpay/test/union/public_rsa.pem'),
            ],
        ],
    ],
    //接口类型
    'type'         => [
        '002025' => '查询',
        '002100' => '交易',
        '002101' => '冲正',
        '002102' => '撤销',
        'openid' => '封装openid参数',
        '106040' => '领券',
        '012100' => '核销通知',
        'code'   => '生活请求发券',
    ],
    //日志类型对应
    'log_type'     => [
        '002025' => 'query',
        '002100' => 'freezecoupon',
        '002101' => 'reversal',
        '002102' => 'annul',
        'openid' => 'openid',
        '106040' => 'getcode',
        '012100' => 'notify',
    ],
    // 签名检查数据  没有为全数据
    'checksign'    => [
        'default' => [
            'in'  => [
                'msg_type',
                'msg_txn_code',
                'msg_crrltn_id',
                'msg_flg',
                'msg_sender',
                'msg_time',
                'msg_sys_sn',
                'msg_ver',
                'sign_type',
            ],
            'out' => [
                'msg_type',
                'msg_txn_code',
                'msg_crrltn_id',
                'msg_flg',
                'msg_sender',
                'msg_sys_sn',
                'msg_time',
                'msg_ver',
                'msg_rsp_code',
                'msg_rsp_desc',
            ],
        ],
        '106040'  => [
            'in'  => [
                'msg_type',
                'msg_txn_code',
                'msg_crrltn_id',
                'msg_flg',
                'msg_sender',
                'msg_time',
                'msg_sys_sn',
                'msg_ver',
                'sign_type',
            ],
            'out' => [
                'msg_type',
                'msg_txn_code',
                'msg_crrltn_id',
                'msg_flg',
                'msg_sender',
                'msg_sys_sn',
                'msg_time',
                'msg_ver',
                'msg_rsp_code',
                'msg_rsp_desc',
            ],
        ],
        '012100'  => [
            'in'  => [
                'msg_type',
                'msg_txn_code',
                'msg_crrltn_id',
                'msg_flg',
                'msg_sender',
                'msg_time',
                'msg_sys_sn',
                'msg_ver',
            ],
            'out' => [
                'msg_type',
                'msg_txn_code',
                'msg_crrltn_id',
                'msg_flg',
                'msg_sender',
                'msg_time',
                'msg_sys_sn',
                'msg_ver',
                'msg_rsp_code',
                'msg_rsp_desc',
            ],
        ],
    ],
    //需要校验的数据
    'validator'    => [
        '002025' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_ver",
            "msg_sys_sn",
            "req_serial_no",
            "mkt_code",
            "amount",
            "avl_amt",
        ],
        '002100' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_sys_sn",
            "msg_ver",
            "req_serial_no",
            "orig_req_serial_no",
            "sett_date",
            "txn_date",
            "txn_time",
            "orig_amt",
            "discount_amt",
        ],
        '002101' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_sys_sn",
            "msg_ver",
            "req_serial_no",
            "orig_req_serial_no",
        ],
        '002102' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_sys_sn",
            "msg_ver",
            "req_serial_no",
            "orig_req_serial_no",
        ],
        //封装openid参数
        'openid' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_sender",
            "callback_type",
            "callback_url",
        ],
        //本时生活领券
        'code'   => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_sender",
            "issue_user_id",
            "event_no",
            "mobile",
        ],

        //本时生活领券
        '106040' => [
            'msg_type',
            'msg_txn_code',
            'msg_crrltn_id',
            //            'msg_flg',
            'msg_sender',
            'msg_time',
            'msg_sys_sn',
            'msg_ver',
            'sp_chnl_no',
            'sp_order_no',
            'order_date',
            'event_no',
            'issue_user_id',
        ],
        //回调核销信息 校验数据项目
        '012100' => [
            'msg_type',
            'msg_txn_code',
            'msg_crrltn_id',
            'msg_flg',
            'msg_sender',
            'msg_time',
            'msg_sys_sn',
            'msg_ver',
            'mchnt_no',
            'term_no',
            'shop_no',
            'req_serial_no',
            'coupon_no',
            'coupon_type',
            // 'enc_card_no',
            'acq_term_sn',
            'refer_no',
            'sett_date',
            'txn_date',
            'txn_time',
            'orig_amt',
            'discount_amt',
            'pay_amt',
            // 'pay_mode',
            'event_no',
        ],
    ],
    //入库基础数据
    'regular'      => [
        '002025' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            //            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_ver",
            "msg_sys_sn", //自己添加的基础数据
            "req_serial_no", //自己添加的基础数据
            "mkt_code", //自己添加的基础数据
        ],
        '002100' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            //            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_sys_sn",
            "msg_ver",
            "req_serial_no", //自己添加的基础数据
            "orig_req_serial_no", //自己添加的基础数据
            "sett_date", //自己添加的基础数据
            "mkt_code", //自己添加的基础数据
        ],
        '002101' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            //            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_sys_sn",
            "msg_ver",
            "req_serial_no", //自己添加的基础数据
            "orig_req_serial_no", //自己添加的基础数据
        ],
        '002102' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            //            "msg_flg",
            "msg_sender",
            "msg_time",
            "msg_sys_sn",
            "msg_ver",
            "req_serial_no", //自己添加的基础数据
            "orig_req_serial_no", //自己添加的基础数据
        ],
        //封装获取openid数据
        'openid' => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_sender",
        ],
        //本时生活领券
        'code'   => [
            "msg_type",
            "msg_txn_code",
            "msg_crrltn_id",
            "msg_sender",
        ],
        //去联盟领券
        '106040' => [
            'msg_type',
            'msg_txn_code',
            'msg_crrltn_id',
            //            'msg_flg',
            'msg_sender',
            'msg_time',
            'msg_sys_sn',
            'msg_ver',
        ],
        //回调核销信息
        '012100' => [
            'msg_type',
            'msg_txn_code',
            'msg_crrltn_id',
            'msg_sender',
            'msg_time',
            'msg_sys_sn',
            'msg_ver',
            'req_serial_no',
            'sett_date',
        ],
    ],
    'fields'       => [
        //聚合营销优惠查询接口
        '002025' => [
            'in'  => [
                "msg_type"          => "报文类型",
                "msg_txn_code"      => "交易代码",
                "msg_crrltn_id"     => "报文流水号",
                "msg_flg"           => "报文请求应答标志",
                "msg_sender"        => "报文发送方",
                "msg_time"          => "报文日期",
                "msg_sys_sn"        => "平台流水号",
                "msg_ver"           => "报文版本号",
                "req_serial_no"     => "查询流水号",
                "shop_no"           => "门店号",
                "term_no"           => "受理终端号",
                "service_code"      => "受理方式",
                "voucher_no"        => "受理凭证号",
                "mkt_code"          => "聚合营销码",
                "mkt_mode"          => "聚合营销类型",
                "embedded_mchnt_no" => "发起渠道商户号",
                "currency_code"     => "货币代码",
                "amount"            => "消费金额",
                "avl_amt"           => "可优惠金额",
                "term_sp_chnl_no"   => "终端指定SP渠道号",
                "func_code"         => "功能码",
                "times"             => "次数",
                // "pay_mode"          => "支付方式",
                //用户附加信息
                "user_ext_info"     => [
                    "mobile_no"      => "手机号",
                    "user_code"      => "用户号",
                    "user_code_type" => "用户号类型",
                    "dev_id"         => "设备id",
                ],
                "sign"              => "签名域",
            ],
            'out' => [
                "msg_type"      => "报文类型",
                "msg_txn_code"  => "交易代码",
                "msg_crrltn_id" => "报文流水号",
                "msg_flg"       => "报文请求应答标志",
                "msg_sender"    => "报文发送方",
                "msg_time"      => "报文日期",
                "msg_sys_sn"    => "平台流水号",
                "msg_rsp_code"  => "响应码",
                "msg_rsp_desc"  => "响应码描述",
                "discount"      => "折扣金额",
                "actual_amt"    => "折后应收金额",
                "pos_display"   => "POS显示",
                "pos_receipt"   => "POS小票",
                "pos_ad"        => "POS广告",
                "pos_mkt_ad"    => "Pos_营销联盟广告",
                "sign"          => "签名域",
            ],
        ],
        //销账交易接口
        '002100' => [
            'in'  => [
                "msg_type"           => "报文类型",
                "msg_txn_code"       => "交易代码",
                "msg_crrltn_id"      => "消息关联号",
                "msg_flg"            => "报文请求应答标志",
                "msg_sender"         => "报文发送方",
                "msg_time"           => "报文日期",
                "msg_sys_sn"         => "平台流水号",
                "msg_ver"            => "报文版本号",
                "shop_no"            => "门店号",
                "term_no"            => "终端号",
                "req_serial_no"      => "销券流水号",
                "orig_req_serial_no" => "原查询流水号",
                //                "enc_card_no"        => "加密卡号",
                "part_card_no"       => "部分卡号",
                "acq_term_sn"        => "受理终端流水号",
                "refer_no"           => "检索参考号",
                "sett_date"          => "清算日期",
                "txn_date"           => "交易日期",
                "txn_time"           => "交易时间",
                "orig_amt"           => "原始金额",
                "discount_amt"       => "优惠的金额",
                "pay_amt"            => "支付金额",
                //                "pay_mode"           => "支付方式",
                "order_no"           => "订单号",
                "trans_crrltn_no"    => "交易关联流水号",
                "equity_no"          => "权益号",
                "card_no"            => "全卡号",
                "sign"               => "签名数据",
            ],
            'out' => [
                "msg_type"        => "报文类型",
                "msg_txn_code"    => "交易代码",
                "msg_crrltn_id"   => "消息关联号",
                "msg_flg"         => "报文请求应答标志",
                "msg_sender"      => "报文发送方",
                "msg_time"        => "报文日期",
                "msg_sys_sn"      => "平台流水号",
                "msg_ver"         => "报文版本号",
                "msg_rsp_code"    => "响应码",
                "msg_rsp_desc"    => "响应码描述",
                "orig_amt"        => "原始金额",
                "discount_amt"    => "折扣金额",
                "pay_amt"         => "支付金额",
                "serv_chg"        => "服务费",
                "commission"      => "佣金",
                "ad"              => "广告",
                "pos_receipt"     => "POS优惠",
                "coupon_no"       => "凭证号",
                "coupon_type"     => "凭证类型",
                "sp_biz_code"     => "SP统计码",
                "charge_code"     => "计费码",
                "pos_event_title" => "SP活动主题",
                "sp_contact"      => "SP联系电话",
                "sp_name"         => "SP名称",
                "event_no"        => "活动号",
                "td_code"         => "二维码",
                "memo"            => "附言",
                "mkt_sp_chnl_no"  => "营销渠道号",
                "point_amt"       => "积分抵扣金额",
                "sign"            => "签名数据",
            ],
        ],
        //销账冲正通知接口
        '002101' => [
            'in'  => [
                "msg_type"           => "报文类型",
                "msg_txn_code"       => "交易代码",
                "msg_crrltn_id"      => "消息关联号",
                "msg_flg"            => "报文请求应答标志",
                "msg_sender"         => "报文发送方",
                "msg_time"           => "报文日期",
                "msg_sys_sn"         => "平台流水号",
                "msg_ver"            => "报文版本号",
                "shop_no"            => "门店号",
                "term_no"            => "终端号",
                "req_serial_no"      => "冲正流水号",
                "orig_req_serial_no" => "原始销账流水号",
                "trans_crrltn_no"    => "交易关联流水号",
                "sign"               => "签名数据",
            ],
            'out' => [
                "msg_type"      => "报文类型",
                "msg_txn_code"  => "交易代码",
                "msg_crrltn_id" => "消息关联号",
                "msg_flg"       => "报文请求应答标志",
                "msg_sender"    => "报文发送方",
                "msg_time"      => "报文日期",
                "msg_sys_sn"    => "平台流水号",
                "msg_ver"       => "报文版本号",
                "msg_rsp_code"  => "响应码",
                "msg_rsp_desc"  => "响应码描述",
                "sign"          => "签名数据",
            ],
        ],
        '002102' => [
            'in'  => [
                "msg_type"           => "报文类型",
                "msg_txn_code"       => "交易代码",
                "msg_crrltn_id"      => "消息关联号",
                "msg_flg"            => "报文请求应答标志",
                "msg_sender"         => "报文发送方",
                "msg_time"           => "报文日期",
                "msg_sys_sn"         => "平台流水号",
                "msg_ver"            => "报文版本号",
                "shop_no"            => "门店号",
                "term_no"            => "终端号",
                "req_serial_no"      => "撤销流水号",
                "orig_req_serial_no" => "原始销账流水号",
                "trans_crrltn_no"    => "交易关联流水号",
                "sign"               => "签名数据",
            ],
            'out' => [
                "msg_type"      => "报文类型",
                "msg_txn_code"  => "交易代码",
                "msg_crrltn_id" => "消息关联号",
                "msg_flg"       => "报文请求应答标志",
                "msg_sender"    => "报文发送方",
                "msg_time"      => "报文日期",
                "msg_sys_sn"    => "平台流水号",
                "msg_ver"       => "报文版本号",
                "msg_rsp_code"  => "响应码",
                "msg_rsp_desc"  => "响应码描述",
                "ad"            => "广告",
                "td_code"       => "二维码",
                "sign"          => "签名数据",
            ],
        ],

        'openid' => [
            'in'  => [
                "msg_type"      => "报文类型",
                "msg_txn_code"  => "交易代码",
                "msg_crrltn_id" => "消息关联号",
                "msg_sender"    => "报文发送方",
                "callback_type" => "回调类型",
                "callback_url"  => "回调地址",
            ],
            'out' => [
                "msg_sender"    => "报文类型",
                "nonce_str"     => "随机码",
                "timestamp"     => "时间戳",
                "auth_scope"    => "授权类型",
                "callback_type" => "回调类型",
                "callback_url"  => "回调地址",
                "sign"          => "签名数据",
            ],
        ],

        'code'   => [
            'in'  => [
                "msg_type"      => "报文类型",
                "msg_txn_code"  => "交易代码",
                "msg_crrltn_id" => "消息关联号",
                "msg_sender"    => "报文发送方",
                "issue_user_id" => "发券平台渠道用户id", //领取微信活动的券码送微信的openid
                "event_no"      => "活动号",
                "mobile"        => "手机号",
            ],
            'out' => [
                "code" => "优惠券",
                "sign" => "签名数据",
            ],
        ],
        //去联盟领券
        '106040' => [
            'in'  => [
                "msg_type"           => "报文类型",
                "msg_txn_code"       => "交易代码",
                "msg_crrltn_id"      => "消息关联号",
                "msg_flg"            => "报文请求应答标志",
                "msg_sender"         => "报文发送方",
                "msg_time"           => "报文日期",
                "msg_sys_sn"         => "平台流水号",
                "msg_ver"            => "报文版本号",
                "shop_no"            => "门店号",
                "term_no"            => "终端号",
                "req_serial_no"      => "撤销流水号",
                "orig_req_serial_no" => "原始销账流水号",
                "trans_crrltn_no"    => "交易关联流水号",
                'sp_chnl_no'         => "渠道方",
                'sp_order_no'        => "第三方订单号",
                'order_date'         => "订单日期",
                'event_no'           => "活动号",
                'issue_user_id'      => "发券平台渠道用户id",
            ],
            'out' => [
                "msg_type"      => "报文类型",
                "msg_txn_code"  => "交易代码",
                "msg_crrltn_id" => "消息关联号",
                "msg_flg"       => "报文请求应答标志",
                "msg_sender"    => "报文发送方",
                "msg_time"      => "报文日期",
                "msg_sys_sn"    => "平台流水号",
                "msg_ver"       => "报文版本号",
                "msg_rsp_code"  => "响应码",
                "msg_rsp_desc"  => "响应码描述",
                "sign"          => "签名数据",
            ],
        ],

        //回调核销信息
        '012100' => [
            'in' => [
                "msg_type"         => "报文类型",
                "msg_txn_code"     => "交易代码",
                "msg_crrltn_id"    => "消息关联号",
                "msg_flg"          => "报文请求应答标志",
                "msg_sender"       => "报文发送方",
                "msg_time"         => "报文日期",
                "msg_sys_sn"       => "平台流水号",
                "msg_ver"          => "报文版本号",
                "mchnt_no"         => "商户号",
                "term_no"          => "终端号",
                "shop_no"          => "门店号",
                "req_serial_no"    => "销券流水号",
                "coupon_no"        => "凭证号",
                "coupon_type"      => "凭证类型",
                // "enc_card_no"      => "加密卡号",
                "acq_term_sn"      => "受理终端流水号",
                "refer_no"         => "检索参考号",
                "sett_date"        => "清算日期",
                "txn_date"         => "交易日期",
                "txn_time"         => "交易时间",
                "orig_amt"         => "原始金额",
                "discount_amt"     => "优惠的金额",
                "pay_amt"          => "支付金额",
                //                "pay_mode"         => "支付方式",
                "event_no"         => "活动号",
                "trans_crrltn_no"  => "交易关联流水号",
                "equity_no"        => "权益号",
                "order_no"         => "订单号",
                "point"            => "使用的积分数量",
                "point_amt"        => "积分抵扣金额",
                "point_account_no" => "积分账户号",
                "mkt_uuid"         => "联盟码申请流水号",
                "custom_info"      => "第三方自定义域",
            ],
        ],

    ],
];
