Beispiel #1
0
 public String callWGGetPf() {
   String result = "";
   String pf = "";
   String pfKey = "";
   if ("cpp".equals(ModuleManager.LANG)) {
     pf = PlatformTest.WGGetPf("game_custom_data");
     pfKey = PlatformTest.WGGetPfKey();
   } else if ("java".equals(ModuleManager.LANG)) {
     pf = WGPlatform.WGGetPf("game_custom_data");
     pfKey = WGPlatform.WGGetPfKey();
   }
   result = "Pf = " + pf;
   result += "\n pfKey = " + pfKey;
   return result;
 }
Beispiel #2
0
  public void launchPaySample() {
    Intent i = new Intent("com.tencent.pay.sdksample.AndroidPaySample");

    LoginRet lr = new LoginRet();
    WGPlatform.WGGetLoginRecord(lr);
    if (lr.flag == CallbackFlag.eFlag_Succ) {
      i.putExtra("userId", lr.open_id);
      i.putExtra("offerId", WeGame.getInstance().offerId);
      if (lr.platform == WeGame.WXPLATID) {
        i.putExtra("userKey", lr.getTokenByType(TokenType.eToken_WX_Access));
        i.putExtra("sessionType", "wc_actoken");
        i.putExtra("sessionId", "hy_gameid");
      } else if (lr.platform == WeGame.QQPLATID) {
        i.putExtra("userKey", lr.getTokenByType(TokenType.eToken_QQ_Pay));
        i.putExtra("sessionType", "kp_actoken");
        i.putExtra("sessionId", "openid");
      }

      i.putExtra("pf", WGPlatform.WGGetPf(""));
      i.putExtra("zoneId", "1");
      i.putExtra("pfKey", WGPlatform.WGGetPfKey());
      i.putExtra("acctType", "common");
      i.putExtra("saveValue", "60");
      i.putExtra("msdk", true);
      try {
        mMainActivity.startActivity(i);
      } catch (ActivityNotFoundException e) {
        AlertDialog.Builder builder = new AlertDialog.Builder(mMainActivity);
        builder.setTitle("拉起支付失败说明");
        String msg =
            "1、支付接口具体调用方法请直接参照TencentMidasV2.3.9d_android_插件版_20150123.zip中进行接入\r\n"
                + "2、每个接口需要的相应参数请通过WGPlatform.WGGetLoginRecord进行获取";
        builder.setMessage(msg);
        builder.setNeutralButton(android.R.string.ok, null);
        builder.create().show();
      }
    }
  }