Ejemplo n.º 1
0
        private static void GetTransaction()
        {
            Console.WriteLine("Enter Transaction ID");
            Guid transactionID = new Guid(Console.ReadLine());

            Console.WriteLine();

            Console.WriteLine("Processing...");
            Console.WriteLine();

            TransactionV1 transactionV1 = new TransactionV1();
            var           result        = JsonConvert.SerializeObject(transactionV1.GetTransaction(transactionID).Result);

            Console.WriteLine(result);
            Console.WriteLine();
        }
Ejemplo n.º 2
0
        private static void ProcessPayment()
        {
            Console.WriteLine("Enter Merchant Account ID");
            Guid merchantAccountID = new Guid(Console.ReadLine());

            Console.WriteLine("Enter Card Number");
            string cardNumber = Console.ReadLine();

            Console.WriteLine("Enter cvv");
            string cvv = Console.ReadLine();

            Console.WriteLine("Enter Expiry Date (MM/YY)");
            string expiryDate = Console.ReadLine();

            Console.WriteLine("Enter Amount");
            int amount = Int16.Parse(Console.ReadLine());

            Console.WriteLine("Enter Currency");
            string currency = Console.ReadLine();

            Console.WriteLine("Enter purchase description");
            string purchaseDescription = Console.ReadLine();

            Console.WriteLine();

            Console.WriteLine("Processing...");
            Console.WriteLine();


            ProcessPaymentV1Model processPaymentV1Model = new ProcessPaymentV1Model
            {
                MerchantAccountID     = merchantAccountID,
                CardNumber            = cardNumber,
                CardVerificationValue = cvv,
                ExpiryDate            = expiryDate,
                Amount              = amount,
                Currency            = currency,
                PurchaseDescription = purchaseDescription
            };

            TransactionV1 transactionV1 = new TransactionV1();
            var           result        = JsonConvert.SerializeObject(transactionV1.Process(processPaymentV1Model).Result);

            Console.WriteLine(result);
            Console.WriteLine();
        }