示例#1
0
 internal static SignalsEnum PostOutcome(KernelDatabaseBase database, KernelQ qManager,
                                         KernelMessageidentifierEnum uiMessage,
                                         KernelStatusEnum uiStatus,
                                         byte[] holdTime,
                                         Kernel2OutcomeStatusEnum status,
                                         Kernel2StartEnum start,
                                         bool?isUIRequestOnOutcomePresent,
                                         KernelMessageidentifierEnum messageOnError,
                                         L1Enum l1Enum,
                                         byte[] SW12,
                                         L2Enum l2Enum,
                                         L3Enum l3Enum)
 {
     return(PostOutcome(database, qManager,
                        uiMessage,
                        uiStatus,
                        holdTime,
                        status,
                        start,
                        isUIRequestOnOutcomePresent,
                        messageOnError,
                        l1Enum,
                        SW12,
                        l2Enum,
                        l3Enum,
                        ValueQualifierEnum.NONE,
                        null,
                        null,
                        false,
                        KernelCVMEnum.N_A));
 }
示例#2
0
        public static SignalsEnum PostOutcomeWithError(KernelDatabaseBase database, KernelQ qManager,
                                                       Kernel2OutcomeStatusEnum status,
                                                       Kernel2StartEnum start,
                                                       L1Enum l1Enum,
                                                       L2Enum l2Enum,
                                                       L3Enum l3Enum)
        {
            if (l1Enum == L1Enum.NOT_SET && l2Enum == L2Enum.NOT_SET && l3Enum == L3Enum.NOT_SET)
            {
                throw new EMVProtocolException("Cannot post with all enum error not set");
            }

            return(PostOutcome(database, qManager,
                               KernelMessageidentifierEnum.N_A,
                               KernelStatusEnum.N_A,
                               null,
                               status,
                               start,
                               null,
                               KernelMessageidentifierEnum.N_A,
                               l1Enum,
                               null,
                               l2Enum,
                               l3Enum,
                               ValueQualifierEnum.NONE,
                               null,
                               null,
                               false,
                               KernelCVMEnum.N_A));
        }
示例#3
0
 private static SignalsEnum DoInvalidReponse(KernelDatabase database, KernelQ qManager, L1Enum l1Enum, L2Enum l2Enum, L3Enum l3Enum)
 {
     return(CommonRoutines.PostOutcome(database, qManager,
                                       KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                       KernelStatusEnum.NOT_READY,
                                       null,
                                       Kernel2OutcomeStatusEnum.END_APPLICATION,
                                       Kernel2StartEnum.N_A,
                                       true, KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                       l1Enum,
                                       null,
                                       l2Enum,
                                       l3Enum));
 }
        private static SignalsEnum DoInvalidResponsePart_D(Kernel2Database database, KernelQ qManager, L1Enum l1Enum, L2Enum l2Enum, L3Enum l3Enum)
        {
            #region 9_10.61 and 9_10.62
            CommonRoutines.CreateEMVDiscretionaryData(database);
            return(CommonRoutines.PostOutcome(database, qManager,
                                              KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                              KernelStatusEnum.NOT_READY,
                                              database.GetDefault(EMVTagsEnum.MESSAGE_HOLD_TIME_DF812D_KRN2).Value,
                                              Kernel2OutcomeStatusEnum.END_APPLICATION,
                                              Kernel2StartEnum.N_A,
                                              true,
                                              KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                              l1Enum,
                                              null,
                                              l2Enum,
                                              l3Enum));

            #endregion
        }
        public static SignalsEnum DoInvalidResponsePart_C(Kernel2Database database, KernelQ qManager, L1Enum l1Enum, L2Enum l2Enum, L3Enum l3Enum)
        {
            #region 9_10.50
            CommonRoutines.UpdateUserInterfaceRequestData(database, KernelMessageidentifierEnum.ERROR_OTHER_CARD, KernelStatusEnum.NOT_READY);
            #endregion

            #region 9_10.51
            IDS_STATUS_DF8128_KRN2 ids = new IDS_STATUS_DF8128_KRN2(database);

            CommonRoutines.CreateEMVDiscretionaryData(database);
            if (ids.Value.IsWrite)
            #endregion
            {
                #region 9_10.52
                CommonRoutines.CreateEMVDataRecord(database);
                #endregion
            }

            #region 9_10.53
            return(CommonRoutines.PostOutcome(database, qManager,
                                              KernelMessageidentifierEnum.N_A,
                                              KernelStatusEnum.N_A,
                                              null,
                                              Kernel2OutcomeStatusEnum.END_APPLICATION,
                                              Kernel2StartEnum.N_A,
                                              true,
                                              KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                              l1Enum,
                                              null,
                                              l2Enum,
                                              l3Enum));

            #endregion
        }
示例#6
0
        public static SignalsEnum DoInvalidResponsePart_C(KernelDatabase database, KernelQ qManager, L1Enum l1Enum, L2Enum l2Enum, L3Enum l3Enum)
        {
            CommonRoutines.UpdateUserInterfaceRequestData(database, KernelMessageidentifierEnum.ERROR_OTHER_CARD, KernelStatusEnum.NOT_READY);
            CommonRoutines.CreateEMVDiscretionaryData(database);
            CommonRoutines.CreateEMVDataRecord(database);

            return(CommonRoutines.PostOutcome(database, qManager,
                                              KernelMessageidentifierEnum.N_A,
                                              KernelStatusEnum.N_A,
                                              null,
                                              Kernel2OutcomeStatusEnum.END_APPLICATION,
                                              Kernel2StartEnum.N_A,
                                              true,
                                              KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                              l1Enum,
                                              null,
                                              l2Enum,
                                              l3Enum));
        }
        private static SignalsEnum DoInvalidResponsePart_C(Kernel2Database database, KernelQ qManager, CardResponse cardResponse, KernelMessageidentifierEnum message, L1Enum l1Enum, L2Enum l2Enum, L3Enum l3Enum)
        {
            #region 11.90
            //done in 11.95
            #endregion

            #region 11.91
            IDS_STATUS_DF8128_KRN2.IDS_STATUS_DF8128_KRN2_VALUE idsV = new IDS_STATUS_DF8128_KRN2.IDS_STATUS_DF8128_KRN2_VALUE(EMVTagsEnum.IDS_STATUS_DF8128_KRN2.DataFormatter);
            idsV.Deserialize(database.TornTempRecord.Children.Get(EMVTagsEnum.IDS_STATUS_DF8128_KRN2.Tag).Value, 0);
            if (!idsV.IsWrite)
            #endregion
            {
                #region 11.92
                database.Get(EMVTagsEnum.TORN_RECORD_FF8101_KRN2).Value = database.TornTempRecord.Value;
                #endregion
            }

            #region 11.93
            IDS_STATUS_DF8128_KRN2 ids = new IDS_STATUS_DF8128_KRN2(database);

            CommonRoutines.CreateEMVDiscretionaryData(database);
            if (ids.Value.IsWrite)
            #endregion
            {
                #region 11.94
                CommonRoutines.CreateEMVDataRecord(database);
                #endregion
            }

            #region 11.95
            return(CommonRoutines.PostOutcome(database, qManager,
                                              KernelMessageidentifierEnum.ERROR_OTHER_CARD,
                                              KernelStatusEnum.NOT_READY,
                                              null,
                                              Kernel2OutcomeStatusEnum.END_APPLICATION,
                                              Kernel2StartEnum.N_A,
                                              true,
                                              message,
                                              l1Enum,
                                              cardResponse.ApduResponse.SW12,
                                              l2Enum,
                                              l3Enum));

            #endregion
        }
示例#8
0
        internal static void UpdateErrorIndication(KernelDatabaseBase database, CardResponse cardResponse, KernelMessageidentifierEnum messageId, L1Enum l1Enum, L2Enum l2Enum, L3Enum l3Enum)
        {
            ERROR_INDICATION_DF8115_KRN2 kei = new ERROR_INDICATION_DF8115_KRN2(database);

            kei.Value.L1Enum     = l1Enum;
            kei.Value.L2Enum     = l2Enum;
            kei.Value.L3Enum     = l3Enum;
            kei.Value.MsgOnError = messageId;
            kei.Value.SW12       = cardResponse.ApduResponse.SW12;
            kei.UpdateDB();
        }
示例#9
0
        internal static SignalsEnum PostOutcome(KernelDatabaseBase database, KernelQ qManager,
                                                KernelMessageidentifierEnum uiMessage,
                                                KernelStatusEnum uiStatus,
                                                byte[] holdTime,
                                                Kernel2OutcomeStatusEnum status,
                                                Kernel2StartEnum start,
                                                bool?isUIRequestOnOutcomePresent,
                                                KernelMessageidentifierEnum messageOnError,
                                                L1Enum l1Enum,
                                                byte[] SW12,
                                                L2Enum l2Enum,
                                                L3Enum l3Enum,
                                                ValueQualifierEnum valueQualifierEnum,
                                                byte[] valueQualifier,
                                                byte[] currencyCode,
                                                bool receipt,
                                                KernelCVMEnum cvmStatus)
        {
            if (messageOnError != KernelMessageidentifierEnum.N_A || l1Enum != L1Enum.NOT_SET || l2Enum != L2Enum.NOT_SET || l3Enum != L3Enum.NOT_SET)
            {
                TLV disc = InitializeDiscretionaryData(database);

                ERROR_INDICATION_DF8115_KRN2 kei = new ERROR_INDICATION_DF8115_KRN2(database);
                kei.Value.MsgOnError = messageOnError;
                kei.Value.L1Enum     = l1Enum;
                kei.Value.L2Enum     = l2Enum;
                kei.Value.L3Enum     = l3Enum;
                if (SW12 != null)
                {
                    kei.Value.SW12 = SW12;
                }
                kei.UpdateDB();

                disc.Children.AddToList(kei);
                disc.Serialize();
            }

            if (uiMessage != KernelMessageidentifierEnum.N_A || uiStatus != KernelStatusEnum.N_A)
            {
                USER_INTERFACE_REQUEST_DATA_DF8116_KRN2 uird = new USER_INTERFACE_REQUEST_DATA_DF8116_KRN2(database);
                uird.Value.KernelMessageidentifierEnum = uiMessage;
                uird.Value.KernelStatusEnum            = uiStatus;
                if (holdTime == null)
                {
                    TLV holdTimeTLV = database.GetDefault(EMVTagsEnum.MESSAGE_HOLD_TIME_DF812D_KRN2);
                    if (holdTimeTLV != null)
                    {
                        holdTime = holdTimeTLV.Value;
                    }
                    else
                    {
                        holdTime = new byte[] { 0x00, 0x00, 0x00 }
                    };
                }
                uird.Value.HoldTime = holdTime;
                if (valueQualifier != null)
                {
                    uird.Value.ValueQualifier = valueQualifier;
                }
                uird.Value.ValueQualifierEnum = valueQualifierEnum;
                if (currencyCode != null)
                {
                    uird.Value.CurrencyCode = currencyCode;
                }
                uird.UpdateDB();
            }

            OUTCOME_PARAMETER_SET_DF8129_KRN2 kops = new OUTCOME_PARAMETER_SET_DF8129_KRN2(database);

            kops.Value.Status = status;
            kops.Value.Start  = start;
            if (isUIRequestOnOutcomePresent == null)
            {
                kops.Value.UIRequestOnOutcomePresent = isUIRequestOnOutcomePresent == false;
                kops.Value.UIRequestOnRestartPresent = isUIRequestOnOutcomePresent == false;
            }
            else
            {
                kops.Value.UIRequestOnOutcomePresent = isUIRequestOnOutcomePresent == true ? true : false;
                kops.Value.UIRequestOnRestartPresent = isUIRequestOnOutcomePresent == true ? false : true;
            }
            kops.Value.DataRecordPresent        = database.Get(EMVTagsEnum.DATA_RECORD_FF8105_KRN2) != null ? true : false;
            kops.Value.DiscretionaryDataPresent = database.Get(EMVTagsEnum.DISCRETIONARY_DATA_FF8106_KRN2) != null ? true : false;
            //kops.Value.Receipt = receipt;
            kops.Value.CVM = cvmStatus;
            kops.UpdateDB();

            qManager.EnqueueToOutput(new KernelOUTResponse(
                                         database.Get(EMVTagsEnum.OUTCOME_PARAMETER_SET_DF8129_KRN2),
                                         database.Get(EMVTagsEnum.ERROR_INDICATION_DF8115_KRN2),
                                         database.Get(EMVTagsEnum.DATA_RECORD_FF8105_KRN2),
                                         database.Get(EMVTagsEnum.DISCRETIONARY_DATA_FF8106_KRN2),
                                         database.Get(EMVTagsEnum.USER_INTERFACE_REQUEST_DATA_DF8116_KRN2)));

            return(SignalsEnum.STOP);
        }