GetOffer() public method

public GetOffer ( ) : Offer
return Offer
Ejemplo n.º 1
0
        public void OnRedeemAutomaticOffer(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.");
                }

                if (RedeemAutomaticOffer != null)
                {
                    RedeemAutomaticOffer(offer);
                }
            }
            catch (Exception e)
            {
                Logger.Error(true, "onRedeemAutomaticOffer", e);
            }
        }
Ejemplo n.º 2
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);
                }
            }
        }