Example #1
0
        public PaymentMethodInfo(PaymentMethodEnum paymentMethod)
        {
            PaymentMethod = paymentMethod;

            string name;

            switch (paymentMethod)
            {
            case PaymentMethodEnum.CreditCard:
                name = "Картой\nVisa/MasterCard";
                break;

            case PaymentMethodEnum.Privat24:
                name = "Приват24";
                break;

            case PaymentMethodEnum.CashInTerminal:
                name = "Наличными в терминале\nПриватБанка";
                break;

            case PaymentMethodEnum.CashInBank:
                name = "Наличными в банке";
                break;

            case PaymentMethodEnum.WireTransfer:
                name = "Безналичный платеж\n(юр. лица)";
                break;

            default:
                name = "?";
                break;
            }

            _Name = name;
        }
Example #2
0
 public Payment(string invoice_title, string payer_name, PaymentMethodEnum payment_method, double amount)
 {
     this.invoice_title  = invoice_title;
     this.payer_name     = payer_name;
     this.payment_method = payment_method;
     this.amount         = amount;
 }
Example #3
0
 /// <summary>
 /// 转换成枚举
 /// </summary>
 public static int PaymentMethodToValue(PaymentMethodEnum enumOption)
 {
     try{
         return((int)enumOption);
     }catch (Exception ex) {
         throw new ArgumentException("enumOption", ex);
     }
 }
Example #4
0
 public Installment(string installedBy, decimal amount,
                    PaymentMethodEnum method, long?reconciliationId)
 {
     InstallmentDate  = DateTime.Now;
     InstallmentBy    = installedBy;
     Amount           = amount;
     Method           = method.ToString();
     ReconciliationId = reconciliationId;
 }
Example #5
0
 public Installment(string installedBy, decimal amount,
     PaymentMethodEnum method, long? reconciliationId)
 {
     InstallmentDate = DateTime.Now;
     InstallmentBy = installedBy;
     Amount = amount;
     Method = method.ToString();
     ReconciliationId = reconciliationId;
 }
Example #6
0
 public Payment(Guid id, decimal value, PaymentMethodEnum paymentMethod, bool?portion, int?quantity, DateTime paymentDate, ActiveEnum active, Guid idProject, Project project)
 {
     Id            = id;
     Value         = value;
     PaymentMethod = paymentMethod;
     Portion       = portion;
     Quantity      = quantity;
     PaymentDate   = paymentDate;
     Active        = active;
     IdProject     = idProject;
     Project       = project;
 }
Example #7
0
        public static AbstractPaymentMethod GetPaymentMethod(PaymentMethodEnum paymentMethod)
        {
            switch (paymentMethod)
            {
            case PaymentMethodEnum.AliPay:
                return(new AliPay());

            case PaymentMethodEnum.WeiXinPay:
                return(new WeiXinPay());

            default:
                throw new NotImplementedException();
            }
        }
        void Pay(string invoice_title, string payer_name, PaymentMethodEnum payment_method, double amount)
        {
            Payment payment = new Payment(invoice_title, payer_name, payment_method, amount);

            if (invoice_list.Find(x => x.Title == invoice_title).Amount_left >= amount && payment.Date <= invoice_list.Find(x => x.Title == invoice_title).Deadline)
            {
                payment_list.Add(payment);
                invoice_list.Find(x => x.Title == invoice_title).Amount_left = invoice_list.Find(x => x.Title == invoice_title).Amount - amount;
                invoice_list.Find(x => x.Title == invoice_title).Payments.Add(payment);
            }
            else
            {
                Console.WriteLine("PAYMENT ERROR");
            }
        }
Example #9
0
 /// <summary>
 /// Sets the PaymentMethod property
 /// </summary>
 /// <param name="paymentMethod">PaymentMethod property</param>
 /// <returns>this instance</returns>
 public Order WithPaymentMethod(PaymentMethodEnum paymentMethod)
 {
     this.paymentMethodField = paymentMethod;
     return(this);
 }
 /// <summary>
 /// Sets the PaymentMethod property
 /// </summary>
 /// <param name="paymentMethod">PaymentMethod property</param>
 /// <returns>this instance</returns>
 public Order WithPaymentMethod(PaymentMethodEnum paymentMethod)
 {
     this.paymentMethodField = paymentMethod;
     return this;
 }
Example #11
0
 public RecordRefundRequest TransactionPaymentMethod(PaymentMethodEnum transactionPaymentMethod)
 {
     m_params.Add("transaction[payment_method]", transactionPaymentMethod);
     return(this);
 }
        private async Task <Data.Entities.Order> CreateOrderAsync(string externalId, User user, Data.Entities.Product product, int amount,
                                                                  string statusInformation = "", PaymentMethodEnum paymentMethod = PaymentMethodEnum.STRIPE, OrderStatusEnum status = OrderStatusEnum.PROCESING)
        {
            var order = new Data.Entities.Order
            {
                ExternalId         = externalId,
                UserId             = user.Id,
                UserEmail          = user.Email,
                UserFullName       = user.FullName,
                ProductId          = product?.Id,
                ProductName        = product?.Name,
                ProductDescription = product?.Description,
                Amount             = amount / 100m,
                Status             = status,
                StatusInformation  = statusInformation,
                PaymentMethod      = paymentMethod,
                CreatedAt          = DateTime.UtcNow,
                ModifiedAt         = DateTime.UtcNow
            };

            await _uow.OrderRepository.AddAsync(order);

            await _uow.CommitAsync();

            return(order);
        }