本文整理汇总了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);
}
}
示例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);
}
示例3: GetPaymentTypeByPymnentTypeID
public static PaymentType GetPaymentTypeByPymnentTypeID(int PymnentTypeID)
{
PaymentType paymentType = new PaymentType();
SqlPaymentTypeProvider sqlPaymentTypeProvider = new SqlPaymentTypeProvider();
paymentType = sqlPaymentTypeProvider.GetPaymentTypeByPymnentTypeID(PymnentTypeID);
return paymentType;
}
示例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();
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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;
}
示例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);
}
示例11: GetPaymentId
private int GetPaymentId(PaymentType paymentType)
{
if (paymentType == PaymentType.GiftAid)
return TestContext.KnownGiftAidPaymentId;
return TestContext.KnownDonationPaymentId;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}