package cn.pluss.platform.ys;

/**
 * 请求参数key值
 * @author djh
 */
public class YSConstants {

    /**
     * 业务
     */
    public static final String BIZ_RESPONSE_JSON = "bizResponseJson";

    /**
     *刷卡支付响应 参数名
     */
    public static final String BAR_CODE_PAY_RESPONSE = "ysepay_online_barcodepay_response";

    /**
     *微信支付支付响应参数
     */
    public static final String YS_WX_PAY_SERVICE_RESPONSE = "ysepay_online_weixin_pay_response";

    /**
     * 支付宝支付响应参数
     */
    public static final String YS_ALIPAY_SERVICE_RESPONSE = "ysepay_online_alijsapi_pay_response";

    /**
     *银联支付支付响应参数
     */
    public static final String YS_YL_INDUSTRY_RESPONSE = "ysepay_online_cupmulapp_qrcodepay_response";

    /**
     * 无卡快捷响应参数
     */
    public static final String YS_FASTPAY_SERVICE_RESPONSE = "ysepay_online_fastpay_response";

    /**
     * 协议快捷响应参数
     */
    public static final String YS_TRUSTEESHIP_SERVICE_RESPONSE = "ysepay_trusteeship_sign_response";

    /**
     * 担保响应参数
     */
    public static final String YS_DELIVERED_SERVICE_RESPONSE = "ysepay_online_trade_delivered_response";

    /**
     * 订单退款响应
     */
    public static final String YS_REFUND_RESPONSE = "ysepay_online_trade_refund_response";


    /**
     * 订单退款查询响应
     */
    public static final String YS_REFUND_QUERY_RESPONSE = "ysepay_online_trade_refund_query_response";

    /**
     * 退款通知类型
     */
    public static final String REFUND_PAY_NOTIFY_CODE = "refund.status.sync";

    /**
     * 支付失败通知类型
     */
    public static final String FAIL_PAY_NOTIFY_CODE = "failpay.status.sync";


    public static final String UPLOAD_IMG_TOKEN_GET = "ysepay_merchant_register_token_get_response";

    public static final String UPLOAD_IMG_TOKEN = "ysepay_merchant_register_token_get_response";

    /**
     * 订单查询
     */
    public static final String ORDER_QUERY_RESPONSE = "ysepay_online_trade_order_query_response";

    /**
     * 银联授权返回
     */
    public static final String YS_YL_AUTH_RESPONSE = "ysepay_online_cupgetmulapp_userid_response";

    public static final String YS_WAP_PAY_RESPONSE = "ysepay_online_alijsapi_pay_response";

    public static final String YS_SPLIT_ACCEPT_RESPONSE = "ysepay_single_division_online_accept_response";

    public static final String YS_SPLIT_REFUND_RESPONSE = "ysepay_online_trade_refund_split_response";

    public static final String YS_SPLIT_QUERY_RESPONSE = "ysepay_single_division_online_query_response";

    public static final String YS_SPLIT_GENERAL_REFUND_RESPONSE = "ysepay_online_trade_refund_general_account_response";

    public static final String YS_MERCHANT_WITHDRAW_ACCEPT_RESPONSE = "ysepay_merchant_withdraw_d0_accept_response";

    public static final String YS_ACTIVE_QR_CODE_PAY_RESPONSE = "ysepay_online_qrcodepay_response";

    public static final String YS_UNION_ACCOUNT_RESPONSE = "ysepay_online_unionaccount_downloadurl_get_response";



    public static final String SUCCES = "SUCCES";

    public static final String FAILED = "FAILED";

    public static final String SUCCESS_CODE = "10000";

    public static final String WX_BANK_TYPE = "1902000";

    public static final String ALI_BANK_TYPE = "1903000";

    public static final String YL_BANK_TYPE = "9001002";

    public static final String SN_BANK_TYPE = "1905000";


    /**
     * 通过商户类型获取行业类型
     * @param merchantType 商户类型
     * @return  行业类型
     */
    public static String getBusinessType(String merchantType) {
        if ("1".equals(merchantType)) {
            return "2";
        }

        return "0";
    }

    /**
     * 商户类型转换
     * @param merchantType 商户类型
     * @return 通道商户类型
     */
    public static String getMerchantType(String merchantType) {
        if ("1".equals(merchantType)) {
            return "3";
        }

        //
        if ("2".equals(merchantType)) {
            return "0";
        }

        return "1";
    }

    /**
     * 获取营业执照到期时间
     * @param bussAuthEndTime
     * @return
     */
    public static String getMerLicenseEnd(String bussAuthEndTime) {
        if ("2099-12-30".equals(bussAuthEndTime)) {
            return "29991231";
        }

        return bussAuthEndTime.replace("-", "");
    }

    /**
     * 身份证到期时间转换
     * @param expireDate    到期时间
     * @return
     */
    public static String getIdCardLongExpire(String expireDate) {
        if ("长期".equals(expireDate)) {
            return "29991231";
        }

        return expireDate.replace("-", "");
    }

    /**
     * 商户全称
     */
    public static final String MER_NAME = "merchantName";

    /**
     * 商户简称
     */
    public static final String MER_ALIAS = "merchantShortName";

    /**
     * 我方商编
     */
    public static final String MER_CODE = "outMerchantNo";

    /**
     * 行业类型
     * 0：一般商户（企业商户、个体商户） 2：平台商户（小微商户、个人商户）
     */
    public static final String BUSINESS_TYPE = "businessType";

    /**
     * 营业执照号
     */
    public static final String MER_LICENSE_CODE = "businessCode";

    /**
     * 营业执照全称
     */
    public static final String MER_LICENSE_NAME = "businessName";

    /**
     * 营业执照开始日期
     */
    public static final String MER_LICENSE_START = "businessExpire";

    /**
     * 营业执照失效期 业务类型为0时必填 格式yyyyMMdd 长期填29991231
     */
    public static final String MER_LICENSE_END = "businessFailure";

    /**
     * 营业执照注册地址
     */
    public static final String MER_LICENSE_ADDRESS = "businessAddress";

    /**
     * 营业执照图片
     */
    public static final String MER_LICENSE_IMG = "businessPic";

    /**
     * 经营地址
     */
    public static final String MER_ADDRESS = "bizAddress";

    /**
     * 法人姓名
     */
    public static final String LEGAL_PERSON_NAME = "lawyerName";

    /**
     * 法人手机号
     */
    public static final String LEGAL_PERSON_PHONE = "lawyerPhone";

    /**
     * 法人证件号
     */
    public static final String LEGAL_PERSON_ID = "lawyerId";

    /**
     * 法人证件正面图
     */
    public static final String LEGAL_PERSON_ID_IMG_FRONT = "lawyerIdPicFront";

    /**
     * 法人证件反面图
     */
    public static final String LEGAL_PERSON_ID_IMG_BACK = "lawyerIdPicBack";

    /**
     * 法人手持身份证正面
     */
    public static final String LEGAL_PERSON_HAND_FRONT = "lawyerIdHandFront";

    /**
     * 法人身份证有效期开始时间
     */
    public static final String LEGAL_PERSON_ID_START = "lawyerIdExpired";

    /**
     * 法人手机号有效期结束时间
     */
    public static final String LEGAL_PERSON_ID_END = "lawyerIdFailure";

    /**
     * 法人国籍，中国传249
     */
    public static final String LEGAL_PERSON_COUNTRY = "lawyerCountry";

    /**
     * 法人职业, 有营业执照必传
     */
    public static final String LEGAL_PERSON_WORK = "lawyerWork";

    /**
     * 法人性别 业务类型为0时必填
     * 0（男） 1（女）
     */
    public static final String LEGAL_PERSON_SEX = "lawyerSex";

    /**
     * 法人地址 业务类型为0时必填
     */
    public static final String LEGAL_PERSON_ADDRESS = "lawyerAddress";

    /**
     * 法人证件类型 00-身份证 01-中国护照 02-军人身份证 03-警官证 04-户口簿 05-临时身份证 06-外国护照 07-港澳通行证 08-台胞通行证 09-离休干部荣誉证 10-军官退休证 11-文职干部退休证 12-军事院校学员证 13-武装警察身份证 14-军官证 15-文职干部证 16-军人士兵证 17-武警士兵证 18-其他证件 19-营业执照
     */
    public static final String LEGAL_PERSON_CARD_TYPE = "lawyerIdType";

    /**
     * 结算账户卡类型 11=对私借记卡,13=对私存折,21=对公借记卡,23=对公存折,12=对私贷记卡 --个人贷记卡
     * 这里只考虑 11 和 21
     */
    public static final String ACCOUNT_CARD_TYPE = "accountCardType";

    /**
     * 结算账户卡号
     */
    public static final String ACCOUNT_CARD_NO = "accountCardno";

    /**
     * 结算账户户名, 结算人姓名
     */
    public static final String ACCOUNT_CARD_NAME = "accountCardnoName";

    /**
     * 结算账户卡正面图片,商户图片进件接口的编号
     */
    public static final String ACCOUNT_CARD_FRONT = "accountCardPicFront";

    /**
     * 开户行省（省市区传中文）
     */
    public static final String OPEN_ACC_PROVINCE = "openAccProvince";

    /**
     * 开户行市
     */
    public static final String OPEN_ACC_CITY = "openAccCity";

    /**
     * 开户行区
     */
    public static final String OPEN_ACC_AREA = "openAccArea";

    /**
     * 开户行编号（支行）, 联行号
     */
    public static final String BANK_CONTACT_LINE = "openAccBanktype";

    /**
     * 联系人姓名
     */
    public static final String CONTACT_PERSON = "personName";

    /**
     * 联系人手机号
     */
    public static final String CONTACT_PERSON_PHONE = "personPhone";

    /**
     * 联系人邮箱
     */
    public static final String CONTACT_PERSON_EMAIL = "personEmail";

    /**
     * 联系人地址
     */
    public static final String CONTACT_PERSON_ADDRESS = "personAddress";

    /**
     * 店铺信息，所在省
     */
    public static final String CONTACT_PROVINCE = "province";

    /**
     * 店铺信息，所在市
     */
    public static final String CONTACT_CITY = "city";

    /**
     * 店铺信息，所在区
     */
    public static final String CONTACT_REGION = "region";

    /**
     * 责任经理
     */
    public static final String BIZ_NAME = "bizName";

    /**
     * MCC码
     */
    public static final String MCC_CODE = "mccCode";

    /**
     * 商户模式 0-个体商户;1-企业商户;3:小微商户
     */
    public static final String MER_TYPE = "merchantType";


    /**
     * 门头照
     */
    public static final String DOOR_FRONT_PIC = "doorFrontPic";

    /**
     * 收银台照
     */
    public static final String CASHIER_PIC = "cashierPic";

    /**
     * 内景照
     */
    public static final String SCENE_PIC = "scenePic";

    /**
     * 微信签约费率 费率 (单 位:%)    注:根据签约的费率来填写，最低不能低于0.21
     */
    public static final String WX_RATE = "wechatSignRate";

    /**
     * 微信费率, 最低扣费 (单位:元) (取值区间：0.01-9999.00)
     */
    public static final String WX_RATE_MIN = "wechatSignMin";

    /**
     * 微信费率, 最高扣费 (单位:元) (取值区间：0.01-9999.00)  注：不能小于9000
     */
    public static final String WX_RATE_MAX = "wechatSignMax";

    /**
     * 支付宝签约费率 费率 (单 位:%)   注:根据签约的费率来填写，最低不能低于0.21
     */
    public static final String ALI_RATE = "alipaySignRate";

    /**
     * 支付宝费率, 最低扣费 (单位:元) (取值区间：0.01-9999.00)
     */
    public static final String ALI_RATE_MIN = "alipaySignMin";

    /**
     * 回调地址
     */
    public static final String NOTIFY_ADDRESS = "notifyAddress";

    /**
     * 支付宝费率, 最高扣费 (单位:元) (取值区间：0.01-9999.00)  注：不能小于9000
     */
    public static final String ALI_RATE_MAX = "alipaySignMax";
}