예제 #1
0
        public void AddCardTest()
        {
            var ran     = new Random();
            var num     = ran.Next(999);
            var cardId  = "eeeee" + num.ToString();
            var cardSvc = new DcPayment.Card();

            cardSvc.AddCard(cardId, "testpublickey", "testPassword", "testFirstName", "testLastName", "123 First St", "TestCity", "90210", "CA", "Australia", "0789643569", "1/1/1990", "*****@*****.**", "testCardHolderName", "1234567890123456", "06", "18", "087");
            var ccDetails = cardSvc.GetCustomerCC(cardId);

            Assert.IsNotNull(ccDetails);
        }
예제 #2
0
        public ActionResult ConfirmBuyBitcoin_Buy(BuyBitcoinViewModel model)
        {
            string     publicKey;
            CreditCard creditCard;

            using (var db = new DiamondCircle_dbEntities())
            {
                var customerId = Helpers.GetLoggedInCustomerId(db);
                //Get the card
                var card = db.Cards.Where(c => (c.CardId == model.CardId && c.CustomerID == customerId)).First();
                publicKey = card.PublicKey;

                //Get the creditCard for this card
                creditCard = db.CreditCards.Where(c => c.CreditCardId == card.CreditCardId).First();
            }
            //TODO: Change to service reference when published
            //using (var atmClient = new DC.AtmService.AtmClient())
            var atmClient = new DCPayment.Card();

            {
                atmClient.PayForAndBuyBitcoin(model.CardId, model.BitcoinAmount, model.Currency, model.Price, 1);
            }
            return(View());
        }