Exemple #1
0
        public static string ObterHash(this GerarEGiftResponse response)
        {
            var hash = response.EntityId;

            hash = hash.Substring(hash.LastIndexOf('/') + 1);
            return(hash);
        }
Exemple #2
0
 public static GenerateEGiftHashResponse Map(this GerarEGiftResponse response)
 {
     return(new GenerateEGiftHashResponse()
     {
         AccountId = response.AccountId,
         EntityId = response.EntityId,
         Status = response.Status
     });
 }
Exemple #3
0
        public static string GerarUrlAtivacao(this GerarEGiftResponse response, string urlTemplate)
        {
            var hash = response.ObterHash();

            if (string.IsNullOrEmpty(urlTemplate) || string.IsNullOrEmpty(hash))
            {
                return("");
            }

            return(string.Format(urlTemplate, hash));
        }
Exemple #4
0
        public static string ObterAccountId(this GerarEGiftResponse response)
        {
            var accountId = response.AccountId;

            if (accountId.Contains("accountId="))
            {
                accountId = accountId.Substring(accountId.IndexOf("accountId="));
                accountId = accountId.Replace("accountId=", "");
                return(accountId);
            }

            return("");
        }