class WxMpMemberCardServiceImpl implements WxMpMemberCardService {

  @Override
  public ActivatePluginParam getActivatePluginParam(String cardId, String outStr) throws WxErrorException {
    JsonObject params = new JsonObject();
    params.addProperty("card_id", cardId);
    params.addProperty("outer_str", outStr);
    String response = this.wxMpService.post(MEMBER_CARD_ACTIVATE_URL, GSON.toJson(params));
    ActivatePluginParamResult result = GSON.fromJson(response, ActivatePluginParamResult.class);
    if (0 == result.getErrcode()) {
      String url = result.getUrl();
      try {
        String decodedUrl = URLDecoder.decode(url, "UTF-8");
        Map<String, String> resultMap = parseRequestUrl(decodedUrl);
        ActivatePluginParam activatePluginParam = new ActivatePluginParam();
        activatePluginParam.setEncryptCardId(resultMap.get("encrypt_card_id"));
        activatePluginParam.setOuterStr(resultMap.get("outer_str"));
        activatePluginParam.setBiz(resultMap.get("biz") + "==");
        return activatePluginParam;
      } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
      }
    }
    return null;
  }

  public  WxMpMemberCardServiceImpl(WxMpService wxMpService);

}