Пример #1
0
        private static void Do22_25(KernelDatabaseBase database, CardHolderVerificationRule cvrCurrentlySelected)
        {
            CARDHOLDER_VERIFICATION_METHOD_CVM_RESULTS_9F34_KRN cvr = new CARDHOLDER_VERIFICATION_METHOD_CVM_RESULTS_9F34_KRN(database);
            TERMINAL_VERIFICATION_RESULTS_95_KRN tvr = new TERMINAL_VERIFICATION_RESULTS_95_KRN(database);
            KernelCVMEnum cvmEnum = KernelCVMEnum.N_A;

            #region cvm.22
            cvmEnum = KernelCVMEnum.NO_CVM;
            tvr.Value.CardholderVerificationWasNotSuccessful = true;
            CommonRoutines.UpdateOutcomeParameterSet(database, cvmEnum);
            tvr.UpdateDB();
            #endregion

            #region cvm.23
            if (((byte)cvrCurrentlySelected.CVMConditionCode & 0x3F) == 0x00)
            #endregion
            {
                #region cvm.24
                cvr.Value.CVMPerformed = cvrCurrentlySelected.CVMRule;
                cvr.Value.CVMCondition = (byte)cvrCurrentlySelected.CVMConditionCode;
                cvr.Value.CVMResult    = 0x01;//failed
                #endregion
            }
            else
            {
                #region cvm.25
                cvr.Value.CVMPerformed = 0x3F;
                cvr.Value.CVMCondition = 0x00;
                cvr.Value.CVMResult    = 0x01;//failed
                #endregion
            }
            cvr.UpdateDB();
        }
            public override int Deserialize(byte[] rawTlv, int pos)
            {
                pos = base.Deserialize(rawTlv, pos);

                byte[] amountXBytes = new byte[4];
                byte[] amountYBytes = new byte[4];
                Array.Copy(Value, 0, amountXBytes, 0, 4);
                Array.Copy(Value, 4, amountYBytes, 0, 4);

                AmountX = Formatting.BcdToLong(amountXBytes);
                AmountY = Formatting.BcdToLong(amountYBytes);

                int noEntriesLength = Value.Length;

                for (int i = 8; i < noEntriesLength;)//dont increment
                {
                    CardHolderVerificationRule r = new CardHolderVerificationRule();
                    i = r.deserialize(Value, i);
                    CardHolderVerificationRules.Add(r);
                }

                return(pos);
            }
Пример #3
0
        private static CVMListIterationReturn IterateCVM(KernelDatabaseBase database, CardHolderVerificationRule cvrCurrentlySelected, long amountX, long amountY)
        {
            #region cvm.10
            if (cvrCurrentlySelected.IsConditionCodeUnderstood())
            #endregion
            {
                #region cvm.11
                if (cvrCurrentlySelected.AllDataRequiredIsAvailable(database))
                #endregion
                {
                    #region cvm.12
                    if (cvrCurrentlySelected.ConditionsSatisfied(database, amountX, amountY))
                    #endregion
                    {
                        #region cvm.15
                        return(CVMListIterationReturn.ConditionsMet);

                        #endregion
                    }
                    else
                    {
                        return(CVMListIterationReturn.ConditionNotMet);
                    }
                }
                else
                {
                    return(CVMListIterationReturn.Error);
                }
            }
            else
            {
                return(CVMListIterationReturn.Error);
            }
        }