当前位置: 首页>>代码示例>>C#>>正文


C# PaymentType类代码示例

本文整理汇总了C#中PaymentType的典型用法代码示例。如果您正苦于以下问题:C# PaymentType类的具体用法?C# PaymentType怎么用?C# PaymentType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PaymentType类属于命名空间,在下文中一共展示了PaymentType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        public OperationResult Create(PaymentType paymentType, long referenceUserId, decimal amount, string description)
        {
            try
            {
                using (YomContainer container = GetYomContainer())
                {
                    Item item = container.Items.Add(new Item
                    {
                        Type = (short)paymentType,
                        UserId = UserService.UserGetCurrent().Id,
                        PayItem = new PayItem
                        {
                            Amount = amount,
                            ReferenceUser = referenceUserId,
                            Description = description,
                        }
                    });

                    container.SaveChanges();
                }

                return OperationResult.Success;
            }
            catch (Exception e)
            {
                return OperationResult.Error(e.Message);
            }
        }
开发者ID:mpodonyi,项目名称:Yom,代码行数:28,代码来源:PaymentService.cs

示例2: GetPaymentIcon

        public static string GetPaymentIcon(PaymentType type, string iconName, string name)
        {
            string folderPath = FoldersHelper.GetPath(FolderType.PaymentLogo, string.Empty, false);

            if (!string.IsNullOrWhiteSpace(iconName) && File.Exists(FoldersHelper.GetPathAbsolut(FolderType.PaymentLogo, iconName)))
            {
                return FoldersHelper.GetPath(FolderType.PaymentLogo, iconName, false);
            }

            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_CreditCard))
            {
                return folderPath + "plasticcard.gif";
            }
            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_ElectronMoney))
            {
                return folderPath + "emoney.gif";
            }
            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_Qiwi))
            {
                return folderPath + "qiwi.gif";
            }
            if (name.Contains(Resources.Resource.Install_UserContols_PaymentView_Euroset))
            {
                return folderPath + "euroset.gif";
            }
            return string.Format("{0}{1}_default.gif", folderPath, (int)type);
        }
开发者ID:AzarinSergey,项目名称:learn,代码行数:27,代码来源:PaymentIcons.cs

示例3: GetPaymentTypeByPymnentTypeID

 public static PaymentType GetPaymentTypeByPymnentTypeID(int PymnentTypeID)
 {
     PaymentType paymentType = new PaymentType();
     SqlPaymentTypeProvider sqlPaymentTypeProvider = new SqlPaymentTypeProvider();
     paymentType = sqlPaymentTypeProvider.GetPaymentTypeByPymnentTypeID(PymnentTypeID);
     return paymentType;
 }
开发者ID:anam,项目名称:gp-HO,代码行数:7,代码来源:PaymentTypeManager.cs

示例4: Init_IncomeNotEditing_PropertiesSetupCorrectly

        public void Init_IncomeNotEditing_PropertiesSetupCorrectly(PaymentType type)
        {
            var accountRepoMock = new Mock<IAccountRepository>();
            accountRepoMock.Setup(x => x.GetList(null)).Returns(new List<AccountViewModel>());

            var paymentManager = new PaymentManager(new Mock<IPaymentRepository>().Object, 
                accountRepoMock.Object,
                new Mock<IRecurringPaymentRepository>().Object,
                new Mock<IDialogService>().Object);

            var settingsManagerMock = new Mock<ISettingsManager>();
            settingsManagerMock.SetupAllProperties();

            var viewmodel = new ModifyPaymentViewModel(new Mock<IPaymentRepository>().Object,
                accountRepoMock.Object,
                new Mock<IDialogService>().Object,
                paymentManager,
                settingsManagerMock.Object,
                new Mock<IMvxMessenger>().Object,
                new Mock<IBackupManager>().Object);

            viewmodel.Init(type);

            //Execute and Assert
            viewmodel.SelectedPayment.ShouldNotBeNull();
            viewmodel.SelectedPayment.Type.ShouldBe(type);
            viewmodel.SelectedPayment.IsTransfer.ShouldBeFalse();
            viewmodel.SelectedPayment.IsRecurring.ShouldBeFalse();
        }
开发者ID:NPadrutt,项目名称:MoneyFox.Windows,代码行数:29,代码来源:ModifyPaymentViewModelTest.cs

示例5: SagePayController

        public SagePayController(IDomain domainService,
            IECommerce ecommerceService,
            IUser userService,
            IWebContent webContentService)
            : base(domainService, ecommerceService, userService, webContentService)
        {
            this.DomainService = domainService;
            this.ECommerceService = ecommerceService;
            this.UserService = userService;

            switch (this.DomainService.GetSettingsValue(BL.SettingsKey.sagePayMode, this.DomainID).ToLowerInvariant())
            {
                case "test":
                    ServerMode = VspServerMode.Test;
                    break;
                case "live":
                    ServerMode = VspServerMode.Live;
                    break;
                default:
                    ServerMode = VspServerMode.Simulator;
                    break;
            }

            switch (this.DomainService.GetSettingsValue(BL.SettingsKey.sagePayMethod, this.DomainID).ToLowerInvariant())
            {
                case "direct":
                    PaymentType = PaymentType.Direct;
                    break;
                default:
                    PaymentType = PaymentType.Server;
                    break;
            }
        }
开发者ID:nhtera,项目名称:CrowdCMS,代码行数:33,代码来源:SagePayController.cs

示例6: PayForTicket

        public Payment PayForTicket(Guid orderID, Guid payingCustomerID, double amount, PaymentType methodOfPayment, Currencies? currency, string creditCard)
        {
            ITicketingServiceOneWay prox = null;
            Guid callId = Guid.NewGuid();
            try
            {
                // Find a proxy to the ticketing service (one way)
                prox = TicketingServiceOneWayProxyFactory.GetProxy(false);
                AutoResetEvent arrived = new AutoResetEvent(false);
                // Create a ResultPackage with a wait handle to wait on until a response arrives (on another channel)
                ResultPackage pack = new ResultPackage() { ResultArrived = arrived };
                ResultsCache.Current.SetPackage(callId, pack);

                // Call the ticketing service via MSMQ channel on another thread.
                Action<ITicketingServiceOneWay> del = (p => p.PayForTicket(orderID, payingCustomerID, amount, methodOfPayment, currency, callId, creditCard));
                del.BeginInvoke(prox, null, null);

                //Wait until result arrives
                arrived.WaitOne(timeout);
                Payment result = (Payment)ResultsCache.Current.GetResult(callId);
                ResultsCache.Current.ClearResult(callId);
                return result;
            }
            catch (Exception ex)
            {
                LoggingManager.Logger.Log(LoggingCategory.Error, StringsResource.FailedToContactTicketing + " " + ex.Message);
                throw new TicketingException(StringsResource.TicketingFailed + " " + ex.Message, ex);
            }
            finally
            {
                if ((prox != null) && ((prox as ICommunicationObject).State == CommunicationState.Opened))
                    (prox as ICommunicationObject).Close();
            }
        }
开发者ID:jonteho,项目名称:ticketing-office,代码行数:34,代码来源:TicketingBridgeService.svc.cs

示例7: PayForTicket

        public void PayForTicket(Guid orderID, Guid payingCustomerID, double amount, PaymentType methodOfPayment, Currencies? currency, Guid callID, string creditCard)
        {
            try
            {
                callback_prox = CallBackChannelFactory.GetProxy(false);
                Payment payment = null;

                // Do the job and call back the ticketing bridge
                payment = generalTicketing.PayForTicket(orderID, payingCustomerID, amount, methodOfPayment, currency, creditCard);


                callback_prox.PaymentArrived(payment, callID);
            }
            catch (TicketingException tex)
            {
                LoggingManager.Logger.Log(LoggingCategory.Error, StringsResource.TicketingFailed + " " + tex.Message);
                throw new TicketingException(StringsResource.TicketingFailed + " " + tex.Message, tex);
            }
            catch (Exception ex)
            {
                LoggingManager.Logger.Log(LoggingCategory.Error, StringsResource.FailedToContactTicketingBridge + " " + ex.Message);
                throw new TicketingException(StringsResource.TicketingFailed + " " + ex.Message, ex);
            }
            finally
            {
                if ((callback_prox != null) && ((callback_prox as ICommunicationObject).State == CommunicationState.Opened))
                    (callback_prox as ICommunicationObject).Close();
            }
        }
开发者ID:jonteho,项目名称:ticketing-office,代码行数:29,代码来源:QueuedTicketingService.svc.cs

示例8: CreatePayment

 public IPayment CreatePayment(DateTime dueDate, decimal dueAmount, IParty payer, 
     IParty payee, PaymentType type, string sale, int booking)
 {
     //Calls the paymentCollection class for create
     return paymentCollection.Create(dueDate, dueAmount, payer, payee, type,
         sale, booking);
 }
开发者ID:Klockz,项目名称:LonelyTreeExam,代码行数:7,代码来源:paymentController.cs

示例9: PaymentInfo

 // constructor
 public PaymentInfo(string paymentId, PaymentType paymentType, DateTime startDate, DateTime endDate)
 {
     this.paymentId = paymentId;
     this.paymentType = paymentType;
     this.startDate = startDate;
     this.endDate = endDate;
 }
开发者ID:itayB,项目名称:FinancePlus,代码行数:8,代码来源:PaymentInfo.cs

示例10: GetRecurringFromPayment_Endless

        public void GetRecurringFromPayment_Endless(PaymentRecurrence recurrence, PaymentType type)
        {
            var startDate = new DateTime(2015, 03, 12);
            var enddate = Convert.ToDateTime("7.8.2016");

            var payment = new PaymentViewModel
            {
                ChargedAccount = new AccountViewModel {Id = 3},
                TargetAccount = new AccountViewModel {Id = 8},
                Category = new CategoryViewModel {Id = 16},
                Date = startDate,
                Amount = 2135,
                IsCleared = false,
                Type = type,
                IsRecurring = true
            };

            var recurring = RecurringPaymentHelper.GetRecurringFromPayment(payment, true,
                recurrence, enddate);

            recurring.ChargedAccount.Id.ShouldBe(3);
            recurring.TargetAccount.Id.ShouldBe(8);
            recurring.StartDate.ShouldBe(startDate);
            recurring.EndDate.ShouldBe(enddate);
            recurring.IsEndless.ShouldBe(true);
            recurring.Amount.ShouldBe(payment.Amount);
            recurring.Category.Id.ShouldBe(payment.Category.Id);
            recurring.Type.ShouldBe(type);
            recurring.Recurrence.ShouldBe(recurrence);
            recurring.Note.ShouldBe(payment.Note);
        }
开发者ID:NPadrutt,项目名称:MoneyFox.Windows,代码行数:31,代码来源:RecurringPaymentHelperTests.cs

示例11: GetPaymentId

        private int GetPaymentId(PaymentType paymentType)
        {
            if (paymentType == PaymentType.GiftAid)
                return TestContext.KnownGiftAidPaymentId;

            return TestContext.KnownDonationPaymentId;
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:7,代码来源:PaymentsApiClientTests.cs

示例12: CreatePayment

        public IPayment CreatePayment(DateTime dueDate, decimal dueAmount, IParty payer, IParty payee, 
            PaymentType type, string sale, int booking)
        {
            PaymentEntity entity = new PaymentEntity(dueDate, dueAmount, payer, payee, type, sale, booking);
            payments.Add(entity);

            return entity;
        }
开发者ID:Klockz,项目名称:LonelyTreeExam,代码行数:8,代码来源:DataAccessFacadeStub.cs

示例13: GetPaymentTypeString

 /// <summary>
 /// Gets the payment type string.
 /// </summary>
 /// <param name="paymentTypeID">The payment type ID.</param>
 /// <returns></returns>
 public static string GetPaymentTypeString(int paymentTypeID)
 {
     PaymentType pType = new PaymentType();
     pType.LoadByPrimaryKey(paymentTypeID);
     if (pType.RowCount > 0)
         return pType.Name;
     return null;
 }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:13,代码来源:PaymentType.cs

示例14: Payment

 public Payment(Purchase parameter, PaymentType type)
 {
     this.purchase = parameter;
     this.paymentDate = DateTime.Now;
     this.amount = parameter.totalAmount;
     this.status = PaymentStatus.Waiting;
     this.type = type;
 }
开发者ID:reisrf,项目名称:JuntosRepository,代码行数:8,代码来源:Payment.cs

示例15: PurchaseItemRequest

 public PurchaseItemRequest(int itemId, int buyAmount, PaymentType paymentOption, int saveLocation, List<int> accessLocation, ConsumeUponPurchase consume = null)
 {
     ItemId = itemId;
     BuyAmount = buyAmount;
     PaymentOption = paymentOption;
     SaveLocation = saveLocation;
     Consume = consume;
 }
开发者ID:SocialPlay,项目名称:KongregateAddon,代码行数:8,代码来源:PurchaseItemRequest.cs


注:本文中的PaymentType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。