public void OpenPayPal() { string url = ShopSettings.inst.GetComponent <PreparePayment>().API_Success.links[1].href; if (Application.platform == RuntimePlatform.WebGLPlayer) { #if UNITY_WEBGL openWindow(url); #endif } else { Application.OpenURL(url); } OrderChecker newPaymentListener = ShopSettings.inst.gameObject.AddComponent <OrderChecker>(); PreparePayment createPaymentAPI_Call = ShopSettings.inst.GetComponent <PreparePayment>(); PreparePaymentResponse createPaymentResponse = createPaymentAPI_Call.API_Success; newPaymentListener.accessToken = createPaymentAPI_Call.accessToken; newPaymentListener.checkInterval = 10f; newPaymentListener.payID = createPaymentResponse.id; InvokeRepeating("CheckOrderStatus", 1f, 1f); SetStatus(CurrentStatus.WAITING); }
private void Success(string response) { API_Success = JsonUtility.FromJson <PreparePaymentResponse>(response); }