#####    jeeppay-plus S3 支付渠道初始化SQL   #####

-- 模拟测试， 会直接响应成功
DELETE FROM t_pay_interface_define WHERE if_code = 'demomockpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, is_support_applyment, is_open_applyment, is_support_check_bill, is_open_check_bill, is_support_cashout, is_open_cashout, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('demomockpay', '【本地模拟支付通道】', 1, 1, 1, 1, 0, 0, 0, 0, 1,
        '[{"name":"accountId","desc":"账号ID","type":"text","verify":"required"}]',
        '[{"name":"paySuccessTime","desc":"支付成功时间:: -1：失败 ；0：直接成功 ； 5/10/15/20/25/30: 多少x后成功 ； >30表示：等待补单时成功","type":"text","verify":"required"}]',
        '[{"name":"paySuccessTime","desc":"支付成功时间:: -1：失败 ；0：直接成功 ； 5/10/15/20/25/30: 多少x后成功 ； >30表示：等待补单时成功","type":"text","verify":"required"}]',
        '[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}, {"wayCode": "ALI_JSAPI"}, {"wayCode": "ALI_WAP"}, {"wayCode": "ALI_BAR"}, {"wayCode": "ALI_APP"}, {"wayCode": "ALI_PC"}, {"wayCode": "ALI_QR"}, {"wayCode": "ALI_LITE"} ]',
        'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/xxxxxxx.png', '#04BE02', 1, '【本地模拟支付通道】');

-- 微信官方
DELETE FROM t_pay_interface_define WHERE if_code = 'wxpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, is_support_applyment, is_open_applyment, is_support_check_bill, is_open_check_bill, is_support_cashout, is_open_cashout, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('wxpay', '微信支付官方', 1, 1, 1, 1, 0, 0, 0, 0, 2,
        '[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥（V3接口必填）", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号（V3接口必填）", "type": "textarea","verify":"","star":"1"},{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
        '[{"name":"subMchId","desc":"子商户ID","type":"text","verify":"required"},{"name":"subMchAppId","desc":"子商户公众号AppId(置空表示使用服务商)","type":"text"},{"name":"subMchLiteAppId","desc":"子商户小程序AppId(置空表示使用服务商)","type":"text"},{"name":"subMchOpenAppId","desc":"子商户App软件微信开放平台中AppId(使用app支付必填)","type":"text"}]',
        '[{"name":"mchId", "desc":"微信支付商户号", "type": "text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"key", "desc":"API密钥", "type": "textarea","verify":"required","star":"1"},{"name":"apiVersion", "desc":"微信支付API版本", "type": "radio","values":"V2,V3","titles":"V2,V3","verify":"required"},{"name":"apiV3Key", "desc":"API V3秘钥（V3接口必填）", "type": "textarea","verify":"","star":"1"},{"name":"serialNo", "desc":"序列号（V3接口必填）", "type": "textarea","verify":"","star":"1" },{"name":"cert", "desc":"API证书(.p12格式)", "type": "file","verify":""},{"name":"apiClientKey", "desc":"私钥文件(.pem格式)", "type": "file","verify":""}]',
        '[{"wayCode": "WX_APP"}, {"wayCode": "WX_H5"}, {"wayCode": "WX_NATIVE"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_LITE"}]',
        'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxpay.png', '#04BE02', 1, '微信官方通道');

-- 支付宝官方
DELETE FROM t_pay_interface_define WHERE if_code = 'alipay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, is_support_applyment, is_open_applyment, is_support_check_bill, is_open_check_bill, is_support_cashout, is_open_cashout, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('alipay', '支付宝官方', 1, 1, 1, 1, 0, 0, 0, 0, 2,
        '[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"pid","desc":"合作伙伴身份（PID）","type":"text","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required","star":"1"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea","star":"1"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书（请使用RSA2私钥）,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书（.crt格式）","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书（.crt格式）","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书（.crt格式）","type":"file","verify":""}]',
        '[{"name":"appAuthToken", "desc":"子商户app_auth_token", "type": "text","readonly":"readonly"},{"name":"refreshToken", "desc":"子商户刷新token", "type": "hidden","readonly":"readonly"},{"name":"expireTimestamp", "desc":"authToken有效期（13位时间戳）", "type": "hidden","readonly":"readonly"}]',
        '[{"name":"sandbox","desc":"环境配置","type":"radio","verify":"","values":"1,0","titles":"沙箱环境,生产环境","verify":"required"},{"name":"appId","desc":"应用App ID","type":"text","verify":"required"},{"name":"privateKey", "desc":"应用私钥", "type": "textarea","verify":"required","star":"1"},{"name":"alipayPublicKey", "desc":"支付宝公钥(不使用证书时必填)", "type": "textarea","star":"1"},{"name":"signType","desc":"接口签名方式(推荐使用RSA2)","type":"radio","verify":"","values":"RSA,RSA2","titles":"RSA,RSA2","verify":"required"},{"name":"useCert","desc":"公钥证书","type":"radio","verify":"","values":"1,0","titles":"使用证书（请使用RSA2私钥）,不使用证书"},{"name":"appPublicCert","desc":"应用公钥证书（.crt格式）","type":"file","verify":""},{"name":"alipayPublicCert","desc":"支付宝公钥证书（.crt格式）","type":"file","verify":""},{"name":"alipayRootCert","desc":"支付宝根证书（.crt格式）","type":"file","verify":""}]',
        '[{"wayCode": "ALI_JSAPI"}, {"wayCode": "ALI_WAP"}, {"wayCode": "ALI_BAR"}, {"wayCode": "ALI_APP"}, {"wayCode": "ALI_PC"}, {"wayCode": "ALI_QR"}, {"wayCode": "ALI_LITE"}]',
        'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/alipay.png', '#1779FF', 1, '支付宝官方通道');

-- 杉德支付
DELETE FROM t_pay_interface_define WHERE if_code = 'sandpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, is_support_applyment, is_open_applyment, is_support_check_bill, is_open_check_bill, is_support_cashout, is_open_cashout, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('sandpay', '杉德支付', 1, 0, 0, 0, 0, 0, 0, 0, 1,
        NULL,
        NULL,
        '[{"name":"mid","desc":"商户ID","type":"text","verify":"required"},{"name":"publicCert","desc":"杉德公钥文件","type":"file","verify":"required"},{"name":"privateCert","desc":"商户私钥文件","type":"file","verify":"required"},{"name":"privatePassword","desc":"商户私钥密码","type":"text","verify":"required","star":"1"},{"name":"md5Key","desc":"MD5签名key","type":"text","star":"1"},{"name":"key1","desc":"手机APK工具生成的key1","type":"text"}]',
        '[{"wayCode":"ALI_BAR"},{"wayCode":"ALI_JSAPI"},{"wayCode":"SAND_H5"}]', 'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/sandpay.png', '#1A2131', 1, '杉德支付');

INSERT INTO t_pay_way (way_code, way_name, way_type) VALUES ('SAND_H5', '杉德H5收银台', 'OTHER');

-- 斗拱支付
DELETE FROM t_pay_interface_define WHERE if_code = 'dgpay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, is_support_applyment, is_open_applyment, is_support_check_bill, is_open_check_bill, is_support_cashout, is_open_cashout, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('dgpay', '斗拱支付', 1, 1, 1, 1, 0, 0, 1, 0, 1,
        '[{"name":"payScene","desc":"进件默认支付场景","type":"radio","verify":"required","values":"1,2","titles":"线下,线上"},{"name":"settleCycle","desc":"商户结算周期","type":"radio","verify":"required","values":"T1,D1","titles":"T1,D1"},{"name":"settleFee","desc":"D1结算费率（填写值为 0.00-100.00 之间）","type":"text","verify":""},{"name":"mchSettManual","desc":"商户手动取现","type":"radio","verify":"required","values":"0,T1,D1,D0","titles":"关闭,T1,D1,D0"},{"name":"cashFee","desc":"取现费率（填写值为 0.00-100.00 之间）","type":"text","verify":""},{"name":"productId","desc":"产品ID","type":"radio","verify":"required","values":"PAYUN,EDUSTD,KAZX","titles":"PAYUN,EDUSTD,KAZX"},{"name":"sysId","desc":"服务商号","type":"text","verify":"required"},{"name":"wxOpenUrl","desc":"微信渠道拓展二维码URL","type":"text","verify":""},{"name":"aliChannelExtUrl","desc":"支付宝渠道拓展二维码URL","type":"text","verify":""},{"name":"channelNo","desc":"微信渠道号（汇付自定义，指定线上或线下支付场景时必填）","type":"text","verify":""},{"name":"agreementModel","desc":"【电子协议】协议模板号","type":"text","verify":""},{"name":"agreementName","desc":"【电子协议】协议模板名称","type":"text","verify":""},{"name":"rsaPrivateKey","desc":"商户私钥","type":"textarea","verify":"required","star":"1"},{"name":"rsaPublicKey","desc":"斗拱公钥","type":"textarea","verify":"required","star":"1"},{"name":"webhookPrivateKey","desc":"webhook终端秘钥（智能POS需配置此项）","type":"textarea","verify":"","star":"1"},{"name":"posPublicKey","desc":"智能POS公钥（智能POS需配置此项）","type":"textarea","verify":"","star":"1"}]',
        '[{"name":"payScene","desc":"支付场景","type":"radio","verify":"required","values":"01,02","titles":"线上,线下"},{"name":"huifuId","desc":"商户号","type":"text","verify":"required"},{"name":"tokenNo","desc":"取现卡序列号（提现功能使用）","type":"text","verify":""}]',
        '[{"name":"payScene","desc":"支付场景","type":"radio","verify":"required","values":"01,02","titles":"线上,线下"},{"name":"huifuId","desc":"商户号","type":"text","verify":"required"},{"name":"productId","desc":"产品ID","type":"text","verify":"required"},{"name":"rsaPrivateKey","desc":"商户私钥","type":"textarea","verify":"required","star":"1"},{"name":"rsaPublicKey","desc":"斗拱公钥","type":"textarea","verify":"required","star":"1"}]',
        '[{"wayCode": "ALI_BAR"}, {"wayCode": "ALI_JSAPI"}, {"wayCode": "ALI_LITE"}, {"wayCode": "ALI_QR"}, {"wayCode": "UP_QR"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_LITE"}, {"wayCode": "YSF_JSAPI"}, {"wayCode": "AUTO_POS"}]', 'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/dgpay.svg', '#B5DCFF', 1, '斗拱支付');

-- 银盛支付
DELETE FROM t_pay_interface_define WHERE if_code = 'yspay';
INSERT INTO t_pay_interface_define (if_code, if_name, is_mch_mode, is_isv_mode, is_support_applyment, is_open_applyment, is_support_check_bill, is_open_check_bill, is_support_cashout, is_open_cashout, config_page_type, isv_params, isvsub_mch_params, normal_mch_params, way_codes, icon, bg_color, state, remark)
VALUES ('yspay', '银盛支付', 0, 1, 1, 1, 0, 0, 0, 0, 1,
        '[{"name":"signType","desc":"加密方式","type":"radio","verify":"required","values":"RSA,SM","titles":"RSA,SM2"},{"name":"settType","desc":"到账方式","type":"radio","verify":"required","values":"1,2,3","titles":"T1,D1,D0"},{"name":"partnerId","desc":"服务商号","type":"text","verify":"required"},{"name":"agtMercId","desc":"代理商编号","type":"text","verify":"required"},{"name":"posPrivateKey","desc":"【智能POS】私钥","type":"text","verify":""},{"name":"wxOpenUrl","desc":"微信渠道拓展二维码URL","type":"text","verify":""},{"name":"wxAppId","desc":"微信公众号/小程序appId","type":"text","verify":""},{"name":"aliChannelExtUrl","desc":"支付宝渠道拓展二维码URL","type":"text","verify":""},{"name":"privateKeyPassword","desc":"私钥证书密码","type":"text","verify":"required"},{"name":"privateKeyFile","desc":"私钥证书（.pfx/.sm2）","type":"file","verify":"required"},{"name":"publicKeyFile","desc":"银盛公钥证书（.cer）","type":"file","verify":"required"}]',
        '[{"name":"mercId","desc":"商户号","type":"text","verify":"required"},{"name":"payType","desc":"商户支付模式","type":"radio","verify":"","values":"1,2","titles":"支付,分账"}]',
        '',
        '[{"wayCode": "ALI_BAR"}, {"wayCode": "ALI_JSAPI"}, {"wayCode": "ALI_LITE"}, {"wayCode": "ALI_QR"}, {"wayCode": "UP_BAR"}, {"wayCode": "UP_QR"}, {"wayCode": "YSF_JSAPI"}, {"wayCode": "WX_BAR"}, {"wayCode": "WX_JSAPI"}, {"wayCode": "WX_LITE"}]', 'http://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/yspay.svg', '#004DA0', 1, '银盛支付');

