public void sendPayment(string pubKey, string secKey, string amount, string status) { string sendPay = MobiusUnity.SendPayment(pubKey, secKey, amount, status); try { PlayerPrefs.SetString("PublicKey", pubKey); PlayerPrefs.SetString("SecretKey", secKey); PlayerPrefs.SetString("Status", status); MobiusUnityObject mobius_unity_object = JsonUtility.FromJson <MobiusUnityObject> (sendPay); Debug.Log("public key : " + mobius_unity_object.publicKey); Debug.Log("secret key : " + mobius_unity_object.secretkey); Debug.Log("balance : " + mobius_unity_object.balance); Debug.Log("error : " + mobius_unity_object.error); _uiManager.loading_panel.SetActive(false); if (mobius_unity_object.error == "NO") { PlayerPrefs.SetString("CB", mobius_unity_object.balance); SceneManager.LoadScene(1); Debug.Log("Payment Successfully Done "); } else { _uiManager.error_panel.SetActive(true); _uiManager.error_text.text = "Error : " + mobius_unity_object.error; } } catch (Exception ex) { Debug.Log(sendPay); // _uiManager.loading_panel.SetActive (false); // _uiManager.error_panel.SetActive (true); // _uiManager.error_text.text = "Error : " + sendPay; _uiManager.loading_panel.SetActive(false); SceneManager.LoadScene(1); } }
public void btnEventRetry() { string sendPay = ""; sendPay = MobiusUnity.SendPayment(PlayerPrefs.GetString("PublicKey"), PlayerPrefs.GetString("SecretKey"), "5", PlayerPrefs.GetString("Status")); try { MobiusUnityObject mobius_unity_object = JsonUtility.FromJson <MobiusUnityObject> (sendPay); Debug.Log("public key : " + mobius_unity_object.publicKey); Debug.Log("secret key : " + mobius_unity_object.secretkey); Debug.Log("balance : " + mobius_unity_object.balance); Debug.Log("error : " + mobius_unity_object.error); if (mobius_unity_object.error == "NO") { PlayerPrefs.SetString("CB", mobius_unity_object.balance); gameOverPanel.SetActive(false); SceneManager.LoadScene(1); } else { error_text.text = mobius_unity_object.error; _errorPanel.SetActive(true); } } catch (Exception ex) { Debug.Log(sendPay); //error_text.text = sendPay; //_errorPanel.SetActive(true); gameOverPanel.SetActive(false); SceneManager.LoadScene(1); } }