GetCode() public method

public GetCode ( ) : string
return string
Ejemplo n.º 1
0
        public void OnRedeemURLSuccess(string response)
        {
            try
            {
                Response answer = new Response(response);

                // Treat the offer.
                Offer offer = answer.GetOffer();
                if (offer == null)
                {
                    throw new NullReferenceException("The returned offer is null.");
                }

                string code = answer.GetCode();
                if (code == null)
                {
                    throw new NullReferenceException("The returned code is null.");
                }

                if (RedeemURLSuccess != null)
                {
                    RedeemURLSuccess(code, offer);
                }
            }
            catch (Exception e)
            {
                Logger.Error(true, "onRedeemURLSuccess", e);
                if (RedeemURLFailed != null)
                {
                    RedeemURLFailed(null, FailReason.UNEXPECTED_ERROR, null);
                }
            }
        }
Ejemplo n.º 2
0
        public void OnRedeemURLCodeFound(string response)
        {
            try
            {
                Response answer = new Response(response);

                string code = answer.GetCode();
                if (code == null)
                {
                    throw new NullReferenceException("The returned code is null.");
                }

                if (RedeemURLCodeFound != null)
                {
                    RedeemURLCodeFound(code);
                }
            }
            catch (Exception e)
            {
                Logger.Error(true, "onRedeemURLCodeFound", e);
            }
        }