public void DoPayByCode() { CommonDic.getInstance().setParameters("subject", "game"); CommonDic.getInstance().setParameters("body", "gamePay"); CommonDic.getInstance().setParameters("order_id", getRamdomTestOrderID()); CommonDic.getInstance().setParameters("total", "0"); CommonDic.getInstance().setParameters("goods_tag", "game"); CommonDic.getInstance().setParameters("notify_url", "www.picovr.com"); CommonDic.getInstance().setParameters("pay_code", GameObject.Find("CodeText").GetComponent <Text>().text); Debug.Log("商品码支付" + GameObject.Find("CodeText").GetComponent <Text>().text); StartLoading(); GameObject.Find("CodeText").GetComponent <Text>().text = ""; InputPanel.SetActive(false); PicoPaymentSDK.Pay(CommonDic.getInstance().PayOrderString()); }
void OnClick(GameObject btnObj) { if (Application.internetReachability == NetworkReachability.NotReachable) { GameObject.Find("MassageInfo").GetComponent <Text>().text = "{" + "\"ret_code\":\"5000\",\n" + "\"ret_msg\":\"NETWORK_ERROR\"" + "}"; return; } switch (btnObj.name) { case "Login": StartLoading(); PicoPaymentSDK.Login(); break; case "PayOne": CommonDic.getInstance().setParameters("subject", "game"); CommonDic.getInstance().setParameters("body", "gamePay"); CommonDic.getInstance().setParameters("order_id", getRamdomTestOrderID()); CommonDic.getInstance().setParameters("total", "1"); CommonDic.getInstance().setParameters("goods_tag", "game"); CommonDic.getInstance().setParameters("notify_url", "www.picovr.com"); CommonDic.getInstance().setParameters("pay_code", ""); StartLoading(); PicoPaymentSDK.Pay(CommonDic.getInstance().PayOrderString()); break; case "PayCode": InputPanel.SetActive(true); break; case "QueryOrder": StartLoading(); PicoPaymentSDK.QueryOrder(currentOrderID); break; case "GetUserAPI": StartLoading(); PicoPaymentSDK.GetUserAPI(); break; } }
void OnClick(GameObject btnObj) { switch (btnObj.name) { case "Login": StartLoading(); LoginSDK.Login(); break; case "PayOne": CommonDic.getInstance().setParameters("subject", "game"); CommonDic.getInstance().setParameters("body", "gamePay"); CommonDic.getInstance().setParameters("order_id", getRamdomTestOrderID()); CommonDic.getInstance().setParameters("total", "1"); CommonDic.getInstance().setParameters("goods_tag", "game"); CommonDic.getInstance().setParameters("notify_url", "www.picovr.com"); CommonDic.getInstance().setParameters("pay_code", ""); StartLoading(); PicoPaymentSDK.Pay(CommonDic.getInstance().PayOrderString()); break; case "PayCode": InputPanel.SetActive(true); break; case "QueryOrder": StartLoading(); PicoPaymentSDK.QueryOrder(currentOrderID); break; case "GetUserAPI": StartLoading(); LoginSDK.GetUserAPI(); break; } }
//ButtonClickedEvent void OnClick(GameObject btnObj) { //判断网络 if (Application.internetReachability == NetworkReachability.NotReachable) { GameObject.Find("MassageInfo").GetComponent <Text>().text = "{" + "\"ret_code\":\"5000\",\n" + "\"ret_msg\":\"NETWORK_ERROR\"" + "}"; return; } switch (btnObj.name) { case "Login": //登陆 StartLoading(); PicoPaymentSDK.Login(); break; case "PayOne": //支付1P币 CommonDic.getInstance().setParameters("subject", "game"); CommonDic.getInstance().setParameters("body", "gamePay"); CommonDic.getInstance().setParameters("order_id", getRamdomTestOrderID()); CommonDic.getInstance().setParameters("total", "1"); CommonDic.getInstance().setParameters("goods_tag", "game"); CommonDic.getInstance().setParameters("notify_url", "www.picovr.com"); CommonDic.getInstance().setParameters("pay_code", ""); StartLoading(); //if (!VerifyLocalToken()) { // return; //} PicoPaymentSDK.Pay(CommonDic.getInstance().PayOrderString()); break; case "PayCode": //使用商品码支付1P币 //if (!VerifyLocalToken()) { // return; //} /* * if (CommonDic.getInstance().access_token.Equals("")) * { * GameObject.Find("MassageInfo").GetComponent<Text>().text = "请先登录"; * currentOrderID = ""; * StopLoading(); * return; * } * */ InputPanel.SetActive(true); break; case "QueryOrder": //查询订单 StartLoading(); //if (currentOrderID.Equals("")) //{ // GameObject.Find("MassageInfo").GetComponent<Text>().text = "{code:exception,msg:请先支付}"; // StopLoading(); // return; //} PicoPaymentSDK.QueryOrder(currentOrderID); break; case "GetUserAPI": //查看用户信息 StartLoading(); PicoPaymentSDK.GetUserAPI(); break; } }