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


C# IInvoice.Currency方法代码示例

本文整理汇总了C#中IInvoice.Currency方法的典型用法代码示例。如果您正苦于以下问题:C# IInvoice.Currency方法的具体用法?C# IInvoice.Currency怎么用?C# IInvoice.Currency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IInvoice的用法示例。


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

示例1: GetMessage

		private MessageObject GetMessage(IInvoice invoice, IPayment payment)
		{
			if (invoice == null || payment == null)
				return null;
			
			MessageObject pay = _messageFactory.CreatePayInit();
			pay.SetAttribute(SaferPayConstants.MessageAttributes.AccountId, _settings.AccountId);
			pay.SetAttribute(SaferPayConstants.MessageAttributes.Amount, (invoice.Total * 100).ToString("##"));
			pay.SetAttribute(SaferPayConstants.MessageAttributes.Currency, invoice.Currency().CurrencyCode);
			pay.SetAttribute(SaferPayConstants.MessageAttributes.Description, _settings.Desciption);
			pay.SetAttribute(SaferPayConstants.MessageAttributes.OrderId, invoice.Key.ToString());

			// return urls
			pay.SetAttribute(SaferPayConstants.MessageAttributes.FailLink, GetWebsiteUrl(SaferPayConstants.Api.FailMethodName, invoice.Key, payment.Key));
			pay.SetAttribute(SaferPayConstants.MessageAttributes.BackLink, GetWebsiteUrl(SaferPayConstants.Api.BackMethodName, invoice.Key, payment.Key));
			pay.SetAttribute(SaferPayConstants.MessageAttributes.SuccessLink, GetWebsiteUrl(SaferPayConstants.Api.SuccessMethodName, invoice.Key, payment.Key));

			// todo: get them settings
			pay.SetAttribute(SaferPayConstants.MessageAttributes.NotifyAddress, _settings.NotifyAddress);
			pay.SetAttribute(SaferPayConstants.MessageAttributes.LangId, System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName);
			pay.SetAttribute(SaferPayConstants.MessageAttributes.ShowLanguages, "yes");

			if (invoice != null)
			{
				IAddress address = invoice.GetBillingAddress();
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Delivery, "no");
				pay.SetAttribute(SaferPayConstants.MessageAttributes.UserNotify, invoice.BillToEmail);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Company, invoice.BillToCompany);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Firstname, invoice.GetBillingAddress().TrySplitFirstName());
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Lastname, invoice.GetBillingAddress().TrySplitLastName());
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Street, invoice.BillToAddress1);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Zip, invoice.BillToPostalCode);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.City, invoice.BillToLocality);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Country, invoice.BillToCountryCode);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.EMail, invoice.BillToEmail);
				pay.SetAttribute(SaferPayConstants.MessageAttributes.Phone, invoice.BillToPhone);
			}

			return pay;
		}
开发者ID:ninjaonsafari,项目名称:Opten.Umbraco.Merchello.Plugins.Payment.SaferPay,代码行数:40,代码来源:SaferPayPaymentProcessor.cs


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