package com.jeequan.jeepay.core.model.params.fuioupay;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * Created by Ricky on 2016/11/19.
 */
public class FuioupayConfig {

    public static String BASE_URL_PAY = "https://spay-cloud.fuioupay.com"; // 支付正式域名
    //    public static String BASE_URL_PAY = "https://spay-xs.fuioupay.com"; // 支付正式域名（旧）
    public static String BASE_URL_PAY2 = "https://spay-mc.fuioupay.com"; // 支付正式域名2
    public static String BASE_URL_PAY_TEST = "https://fundwx.fuiou.com"; // 支付测试域名

    public static String BASE_URL_APPLY = "https://mchntapi.fuioupay.com"; // 进件正式域名
    public static String BASE_URL_APPLY_TEST = "http://www-1.fuiou.com:28090/wmp"; // 进件测试域名

    public static String BASE_URL_SHARE = "https://ordupz.fuioupay.com"; // 分账正式域名
    public static String BASE_URL_SHARE_TEST = "https://ordupz-test.fuioupay.com"; // 分账测试域名

    public static String charset = "GBK"; // 编码

    public static String version = "1.0"; // 版本号

    public static String currType = "CNY"; // 币种

    public static String PAY_SUCCESS = "SUCCESS"; // 成功
    public static String PAY_PAYERROR = "PAYERROR"; // 失败
    public static String PAY_USERPAYING = "USERPAYING"; // 支付中
    public static String PAY_NOTPAY = "NOTPAY"; // 未支付
    public static String PAY_CLOSED = "CLOSED"; // 已关闭
    public static String PAY_REVOKED = "REVOKED"; // 已撤销
    public static String PAY_REFUND = "REFUND"; // 已退款

    public static String REFUND_SUCCESS = "SUCCESS"; // 退款成功
    public static String REFUND_PAYERROR = "PAYERROR"; // 退款失败

    // 订单类型
    public static String ORDER_TYPE_ALIPAY = "ALIPAY";
    public static String ORDER_TYPE_WECHAT = "WECHAT";
    public static String ORDER_TYPE_UNIONPAY = "UNIONPAY";
    public static String ORDER_TYPE_BESTPAY = "BESTPAY";
    public static String ORDER_TYPE_DIGICCY = "DIGICCY";

    public static String TRADE_TYPE_JSAPI = "JSAPI"; // 公众号支付
    public static String TRADE_TYPE_FWC = "FWC"; // 支付宝服务窗、支付宝小程序
    public static String TRADE_TYPE_LETPAY = "LETPAY"; // 微信小程序
    public static String TRADE_TYPE_BESTPAY = "BESTPAY"; // 翼支付js
    public static String TRADE_TYPE_MPAY = "MPAY"; // 云闪付小程序（控件支付）
    public static String TRADE_TYPE_UNIONPAY = "UNIONPAY"; // 云闪付扫码
    public static String TRADE_TYPE_UPBXJS = "UPBXJS"; // 云闪付保险缴费


    public static String FUIOU_MICROPAY = "/micropay"; //扫码
    public static String FUIOU_WXPRECREAT = "/wxPreCreate"; //公众号/服务窗统一下单
    public static String FUIOU_QUERY = "/commonQuery"; //查单
    public static String FUIOU_REFUND = "/commonRefund"; //退款
    public static String FUIOU_REFUND_QUERY = "/refundQuery"; //退款查询
    public static String FUIOU_REFUND_CLOSE_ORDER ="/closeorder"; //关闭订单
    public static String FUIOU_AUTH2OPENID ="/auth2Openid"; // 银联授权码获取user_id


    public static String SUCCESS_CODE = "000000"; // 支付成功应答码
    public static String SUCCESS_CODE_APPLY = "0000"; // 进件成功应答码

    public static byte POS_PAY_SUCCESS_CODE = 1; // 支付成功应答码
    public static byte POS_REFUND_SUCCESS_CODE = 2; // 退款成功应答码

    // 条码、退款待查单应答码
    public static List<String> needQueryOrderResultCodeList = new LinkedList<>();
    static {
        needQueryOrderResultCodeList.add("030010");
        needQueryOrderResultCodeList.add("010002");
        needQueryOrderResultCodeList.add("9999");
        needQueryOrderResultCodeList.add("010001");
        needQueryOrderResultCodeList.add("2001");
        needQueryOrderResultCodeList.add("2002");
    }

    public static String getPayBaseUrl(Byte sandBox) {
        return sandBox == null || sandBox == 0 ? BASE_URL_PAY : BASE_URL_PAY_TEST;
    }
    public static String getApplyBaseUrl(Byte sandBox) {
        return sandBox == null || sandBox == 0 ? BASE_URL_APPLY : BASE_URL_APPLY_TEST;
    }
    public static String getShareBaseUrl(Byte sandBox) {
        return sandBox == null || sandBox == 0 ? BASE_URL_SHARE : BASE_URL_SHARE_TEST;
    }

    public static Map<String, String> SETTLE_TP_CODE_MAP = new HashMap<>();

    static {
        SETTLE_TP_CODE_MAP.put("0.20", "M0110");
        SETTLE_TP_CODE_MAP.put("0.21", "M0139");
        SETTLE_TP_CODE_MAP.put("0.22", "Z0413");
        SETTLE_TP_CODE_MAP.put("0.23", "Z0323");
        SETTLE_TP_CODE_MAP.put("0.24", "M0083");
        SETTLE_TP_CODE_MAP.put("0.25", "M0196");
        SETTLE_TP_CODE_MAP.put("0.26", "M0175");
        SETTLE_TP_CODE_MAP.put("0.27", "M0174");
        SETTLE_TP_CODE_MAP.put("0.28", "Z0194");
        SETTLE_TP_CODE_MAP.put("0.29", "Z0584");
        SETTLE_TP_CODE_MAP.put("0.30", "M0215");
        SETTLE_TP_CODE_MAP.put("0.31", "M2002");
        SETTLE_TP_CODE_MAP.put("0.32", "M2003");
        SETTLE_TP_CODE_MAP.put("0.33", "M0261");
        SETTLE_TP_CODE_MAP.put("0.34", "M2004");
        SETTLE_TP_CODE_MAP.put("0.35", "M0136");
        SETTLE_TP_CODE_MAP.put("0.36", "M0340");
        SETTLE_TP_CODE_MAP.put("0.37", "M2005");
        SETTLE_TP_CODE_MAP.put("0.38", "M0325");
        SETTLE_TP_CODE_MAP.put("0.39", "M2006");
        SETTLE_TP_CODE_MAP.put("0.40", "M0022");
        SETTLE_TP_CODE_MAP.put("0.41", "M2007");
        SETTLE_TP_CODE_MAP.put("0.42", "M0493");
        SETTLE_TP_CODE_MAP.put("0.43", "M0408");
        SETTLE_TP_CODE_MAP.put("0.44", "Z0394");
        SETTLE_TP_CODE_MAP.put("0.45", "M0068");
        SETTLE_TP_CODE_MAP.put("0.46", "M0355");
        SETTLE_TP_CODE_MAP.put("0.47", "M0074");
        SETTLE_TP_CODE_MAP.put("0.48", "M0072");
        SETTLE_TP_CODE_MAP.put("0.49", "M0356");
        SETTLE_TP_CODE_MAP.put("0.50", "M0049");
        SETTLE_TP_CODE_MAP.put("0.51", "M1084");
        SETTLE_TP_CODE_MAP.put("0.52", "M0079");
        SETTLE_TP_CODE_MAP.put("0.53", "M2009");
        SETTLE_TP_CODE_MAP.put("0.54", "Z0392");
        SETTLE_TP_CODE_MAP.put("0.55", "M0069");
        SETTLE_TP_CODE_MAP.put("0.56", "M1082");
        SETTLE_TP_CODE_MAP.put("0.57", "M1074");
        SETTLE_TP_CODE_MAP.put("0.58", "Z0193");
        SETTLE_TP_CODE_MAP.put("0.59", "Z0203");
    }
}
