Ejemplo n.º 1
0
        public override IPayment CreatePayment(decimal amount, IOrderGroup orderGroup)
        {
            var payment = orderGroup.CreateCardPayment(OrderGroupFactory);

            payment.CardType          = "Credit card";
            payment.PaymentMethodId   = PaymentMethodId;
            payment.PaymentMethodName = SystemKeyword;
            payment.Amount            = amount;
            if (UseSelectedCreditCard && !string.IsNullOrEmpty(SelectedCreditCardId))
            {
                CreditCard creditCard = _creditCardService.GetCreditCard(SelectedCreditCardId);
                payment.CreditCardNumber       = creditCard.CreditCardNumber;
                payment.CreditCardSecurityCode = creditCard.SecurityCode;
                payment.ExpirationMonth        = creditCard.ExpirationMonth ?? 1;
                payment.ExpirationYear         = creditCard.ExpirationYear ?? DateTime.Now.Year;
            }
            else
            {
                payment.CreditCardNumber       = CreditCardNumber;
                payment.CreditCardSecurityCode = CreditCardSecurityCode;
                payment.ExpirationMonth        = ExpirationMonth;
                payment.ExpirationYear         = ExpirationYear;
            }
            payment.Status          = PaymentStatus.Pending.ToString();
            payment.CustomerName    = CreditCardName;
            payment.TransactionType = TransactionType.Authorization.ToString();
            return(payment);
        }
Ejemplo n.º 2
0
        public override IPayment CreatePayment(decimal amount, IOrderGroup orderGroup)
        {
            var payment = orderGroup.CreateCardPayment(OrderGroupFactory);

            payment.CardType               = "Credit card";
            payment.PaymentMethodId        = PaymentMethodId;
            payment.PaymentMethodName      = SystemKeyword;
            payment.Amount                 = amount;
            payment.CreditCardNumber       = CreditCardNumber;
            payment.CreditCardSecurityCode = CreditCardSecurityCode;
            payment.ExpirationMonth        = ExpirationMonth;
            payment.ExpirationYear         = ExpirationYear;
            payment.Status                 = PaymentStatus.Pending.ToString();
            payment.CustomerName           = CreditCardName;
            return(payment);
        }