Exemplo n.º 1
0
        public NotificationPushBVG NotificationPush(NotificationPushBVG notificationPush)
        {
            string publicRequestKey = (string)(notificationPush.GetGeneralData()[ElementNames.BVG_PUBLIC_REQUEST_KEY]);
            string URL = endpoint + BVTP_NOTIFICATION_PUSH + "/" + publicRequestKey;

            string json = OperationsParserBVG.GenerateNotificationPushJson(notificationPush);

            string result = ExecuteRequest(json, URL, METHOD_PUT, true);

            return(OperationsParserBVG.ParseJsonToNotificationPushBVG(result));
        }
Exemplo n.º 2
0
        public static string GenerateNotificationPushJson(NotificationPushBVG notificationPush)
        {
            Dictionary <string, object> aux = new Dictionary <string, object>();

            aux.Add(ElementNames.BVG_GENERAL_DATA, notificationPush.GetGeneralData());
            aux.Add(ElementNames.BVG_OPERATION_DATA, notificationPush.GetOperationData());
            aux.Add(ElementNames.BVG_TOKENIZATION_DATA, notificationPush.GetTokenizationData());

            string notificationPushJson = JsonConvert.SerializeObject(aux, Newtonsoft.Json.Formatting.Indented);

            return(notificationPushJson);
        }
Exemplo n.º 3
0
        public Boolean ValidateNotificationPush(NotificationPushBVG notificationPush)
        {
            Boolean valid = true;
            Dictionary <string, Object> generalData      = notificationPush.GetGeneralData();
            Dictionary <string, Object> operationData    = notificationPush.GetOperationData();
            Dictionary <string, Object> tokenizationData = notificationPush.GetTokenizationData();

            valid = ValidateGeneralData(generalData) && ValidateOperationData(operationData);
            valid = valid && ValidateTokenizationData(tokenizationData);
            valid = valid && ValidateFormatNotificationPush(generalData, operationData, tokenizationData);

            return(valid);
        }