package com.kmall.api.util;

import com.kmall.manager.manager.pay.wxpay.WxPayPropertiesBuilder;

/**
 * 作者: @author Scott <br>
 * 时间: 2017-08-11 08:58<br>
 * 描述: ApiUserUtils <br>
 */
public class ApiUserUtils {

    //替换字符串
    public static String getCode(String APPID, String REDIRECT_URI, String SCOPE) {
        return String.format(WxPayPropertiesBuilder.instance().getGetCode(), APPID, REDIRECT_URI, SCOPE);
//        return String.format(CommonWxGlobalPayPropertiesBuilder.instance().getGetCode(), APPID, REDIRECT_URI, SCOPE);
    }

    //替换字符串
    public static String getWebAccess(String CODE) {
        return String.format(
                WxPayPropertiesBuilder.instance().getWebAccessTokenhttps(),
                WxPayPropertiesBuilder.instance().getAppId(),
                WxPayPropertiesBuilder.instance().getSecret(),
                CODE);
//        return String.format(
//                //ResourceUtil.getConfigByName("wx.webAccessTokenhttps"),
//                CommonWxGlobalPayPropertiesBuilder.instance().getWebAccessTokenhttps(),
//                //ResourceUtil.getConfigByName("wx.appId"),
//                CommonWxGlobalPayPropertiesBuilder.instance().getAppId(),
//                //ResourceUtil.getConfigByName("wx.secret"),
//                CommonWxGlobalPayPropertiesBuilder.instance().getSecret(),
//                CODE);
    }

    //替换字符串
    public static String getUserMessage(String access_token, String openid) {
        return String.format(WxPayPropertiesBuilder.instance().getUserMessage(), access_token, openid);
//        return String.format(CommonWxGlobalPayPropertiesBuilder.instance().getUserMessage(), access_token, openid);
    }
}