示例#1
0
        /// <summary>
        /// create new transaction
        /// </summary>
        /// <param name="type"></param>
        /// <param name="userId"></param>
        /// <param name="accountNumber"></param>
        /// <param name="amount"></param>
        public void logTransaction(transactionType type, int userId, int accountNumber, decimal amount = 0)
        {
            Transaction newTransaction = new Transaction {
                type          = type,
                userId        = userId,
                accountNumber = accountNumber,
                amount        = amount
            };

            _transactionRepository.addTransaction(newTransaction);
        }
        public string TestGetThreeDSessionPaycell()
        {
            string          msisdn          = "905465553333";
            string          cardId          = "4aa05cfe-af9c-43d5-971f-a69234ffaf4d";
            string          amount          = "112";
            target          target          = target.MERCHANT;
            transactionType transactionType = transactionType.AUTH;

            string threeDSessionId = GetThreeDSessionId(target, msisdn, cardId, transactionType, amount, false);

            Assert.IsNotNull(threeDSessionId);
            return(threeDSessionId);
        }
示例#3
0
 public Stock(string id, int c, String e, transactionType t, int q, string st, DateTime ti, double p, bool ex, string cu)
 {
     this.id = id;
     this.client = c;
     this.email = e;
     this.type = t;
     this.quantity = q;
     this.sType = st;
     this.time = ti;
     this.price = p;
     this.executed = ex;
     this.currency = cu;
 }
示例#4
0
 public Stock(string id, int c, String e, transactionType t, int q, string st, DateTime ti, double p, bool ex, string cu)
 {
     this.id       = id;
     this.client   = c;
     this.email    = e;
     this.type     = t;
     this.quantity = q;
     this.sType    = st;
     this.time     = ti;
     this.price    = p;
     this.executed = ex;
     this.currency = cu;
 }
示例#5
0
        public KmehrTransactionBuilder NewPharmaceuticalPrescriptionTransaction(string id, DateTime currentDateTime, bool isComplete = false, bool isValidated = false, DateTime?expirationDate = null)
        {
            var transaction = new transactionType
            {
                cd = new CDTRANSACTION[1]
                {
                    new CDTRANSACTION
                    {
                        S     = CDTRANSACTIONschemes.CDTRANSACTION,
                        SV    = KmehrConstant.ReferenceVersion.CD_PHARMACEUTICAL_PRESCRIPTION_VERSION,
                        Value = KmehrConstant.TransactionNames.PHARMACEUTICAL_PRESCRIPTION
                    }
                },
                date        = currentDateTime.ToString("yyyy:mm:dd"),
                time        = currentDateTime.ToString("hh:mm:ss"),
                iscomplete  = isComplete,
                isvalidated = isValidated
            };

            if (expirationDate != null)
            {
                transaction.expirationdate = expirationDate.Value;
            }

            if (!string.IsNullOrWhiteSpace(id))
            {
                transaction.id = new IDKMEHR[1]
                {
                    new IDKMEHR
                    {
                        S     = IDKMEHRschemes.IDKMEHR,
                        SV    = KmehrConstant.ReferenceVersion.ID_KMEHR_VERSION,
                        Value = id
                    }
                };
            }

            _transactionType = transaction;
            return(this);
        }
示例#6
0
        private static PharmaceuticalPrescriptionMedication ToPharmaMedication(transactionType transaction)
        {
            var headingType      = transaction.Items.First() as headingType;
            var itemType         = headingType.Items.First() as itemType;
            var medicinalProduct = itemType.content.First().Items.First() as medicinalProductType;
            var result           = new PharmaceuticalPrescriptionMedication
            {
                PackageCode = medicinalProduct.intendedcd.First().Value
            };

            if (itemType.posology.ItemsElementName.Any(_ => _ == ItemsChoiceType3.text))
            {
                var textType = itemType.posology.Items.First() as textType;
                result.Posology = new PharmaceuticalPrescriptionFreeTextPosologyResult
                {
                    Content = textType.Value
                };
            }
            else
            {
            }

            return(result);
        }
        public string GetThreeDSessionId(target target, string msisdn, string cardId, transactionType transactionType, string amount, bool isOilService)
        {
            GetThreeDSessionRequestFactory factory = new GetThreeDSessionRequestFactory();

            factory.request.target          = target;
            factory.request.amount          = amount;
            factory.request.msisdn          = msisdn;
            factory.request.cardId          = cardId;
            factory.request.transactionType = transactionType;

            getThreeDSessionRequest  request  = factory.Build();
            getThreeDSessionResponse response = new GetThreeDSessionClientService().SoapClient(request);

            Assert.IsNotNull(response);
            Assert.AreEqual("Success", response.responseHeader.responseDescription);
            return(response.threeDSessionId);
        }
示例#8
0
 public static async Task <int> addTransactionLog(int userId, string username, transactionType type, transactionStatus status, methodType method, string email, decimal amount)
 {
     if (type == transactionType.sell)
     {
         return(await databaseManager.updateQuery($"INSERT INTO transactions (userId, email, username, amount, type, method, status, confirmDate) VALUES ('{userId}', '{email}', '{username}', '{amount}', '{( int ) type}', '{( int ) method}', '{(int)status}',  DATE_ADD(now(), INTERVAL 10 DAY) ) ").Execute( ));
     }
     else
     {
         return(await databaseManager.updateQuery($"INSERT INTO transactions (userId, email, username, amount, type, method, status, confirmDate) VALUES ('{userId}', '{email}', '{username}', '{amount}', '{( int ) type}', '{( int ) method}', '{( int ) status}',  CURRENT_DATE() ) ").Execute( ));
     }
 }