Exemple #1
0
 public static bool ValidateBusinessEvent(string currency, int amount, string cartType, string itemType, string itemId)
 {
     if (!GAValidator.ValidateCurrency(currency))
     {
         Debug.Log(string.Concat("Validation fail - business event - currency: Cannot be (null) and need to be A-Z, 3 characters and in the standard at openexchangerates.org. Failed currency: ", currency));
         return(false);
     }
     if (!GAValidator.ValidateShortString(cartType, true))
     {
         Debug.Log(string.Concat("Validation fail - business event - cartType. Cannot be above 32 length. String: ", cartType));
         return(false);
     }
     if (!GAValidator.ValidateEventPartLength(itemType, false))
     {
         Debug.Log(string.Concat("Validation fail - business event - itemType: Cannot be (null), empty or above 64 characters. String: ", itemType));
         return(false);
     }
     if (!GAValidator.ValidateEventPartCharacters(itemType))
     {
         Debug.Log(string.Concat("Validation fail - business event - itemType: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: ", itemType));
         return(false);
     }
     if (!GAValidator.ValidateEventPartLength(itemId, false))
     {
         Debug.Log(string.Concat("Validation fail - business event - itemId. Cannot be (null), empty or above 64 characters. String: ", itemId));
         return(false);
     }
     if (GAValidator.ValidateEventPartCharacters(itemId))
     {
         return(true);
     }
     Debug.Log(string.Concat("Validation fail - business event - itemId: Cannot contain other characters than A-z, 0-9, -_., ()!?. String: ", itemId));
     return(false);
 }