FreshToken() public static method

public static FreshToken ( Action tokenCallback ) : IEnumerator
tokenCallback Action
return IEnumerator
示例#1
0
        public void CreatePaymentForm()
        {
            GameObject newItem = Instantiate(Resources.Load("Prefabs/XsollaPaystation")) as GameObject;
            XsollaPaystationController formController = newItem.GetComponent <XsollaPaystationController> ();

            formController.OkHandler    += (status) => { Debug.Log("OkHandler 1 " + status); };
            formController.ErrorHandler += (error) => { Debug.Log("ErrorHandler 2 " + error); };
            StartCoroutine(XsollaJsonGenerator.FreshToken((token) => SetToken(formController, token)));
        }
示例#2
0
        public void CreatePaymentForm()
        {
            XsollaPaystationController formController = GetPaystationController();

            formController.OkHandler    += (status) => { Debug.Log("OkHandler 1 " + status); };
            formController.ErrorHandler += (error) => { Debug.Log("ErrorHandler 2 " + error); };

            XsollaJsonGenerator generator = new XsollaJsonGenerator("user_1", 14004);             //test 15764

            generator.user.name         = "John Smith";
            generator.user.email        = "*****@*****.**";
            generator.user.country      = "US";
            generator.settings.currency = "USD";
            generator.settings.languge  = "en";
            string request = generator.GetPrepared();

            // Prepare args
            Dictionary <string, object> dataArgs = new Dictionary <string, object>();

            dataArgs.Add("data", request);
            StartCoroutine(XsollaJsonGenerator.FreshToken((token) => SetToken(formController, token)));
        }