本文整理汇总了C#中OrderInfo.AddCustomerFields方法的典型用法代码示例。如果您正苦于以下问题:C# OrderInfo.AddCustomerFields方法的具体用法?C# OrderInfo.AddCustomerFields怎么用?C# OrderInfo.AddCustomerFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderInfo
的用法示例。
在下文中一共展示了OrderInfo.AddCustomerFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePaymentRequest
/// <summary>
/// Creates a payment request for this payment provider
/// </summary>
/// <param name="orderInfo"> </param>
/// <returns>Payment request</returns>
public PaymentRequest CreatePaymentRequest(OrderInfo orderInfo)
{
var paymentProvider = PaymentProvider.GetPaymentProvider(orderInfo.PaymentInfo.Id, orderInfo.StoreInfo.Alias);
#region build urls
var returnUrl = paymentProvider.SuccessUrl();
var reportUrl = paymentProvider.ReportUrl();
var testMode = paymentProvider.TestMode; //currently we don't have a testmode for easy-ideal this var is unused
#endregion
#region config helper
var merchantId = paymentProvider.GetSetting("merchantId");
var merchantKey = paymentProvider.GetSetting("merchantKey");
var merchantSecret = paymentProvider.GetSetting("merchantSecret");
var url = paymentProvider.GetSetting("url");
#endregion
var args = new SortedList<string, string>();
var ci = new CultureInfo("en-US");
args.Add("Amount", orderInfo.ChargedAmount.ToString("G", ci));
args.Add("Currency", "EUR");
args.Add("Bank", orderInfo.PaymentInfo.MethodId);
args.Add("Description", orderInfo.OrderNumber);
args.Add("Return", reportUrl);
var xmlRequest = GetXml(IDEAL_EXECUTE, args, merchantId, merchantKey, merchantSecret);
XDocument xmlResponse = XDocument.Parse(PostXml(xmlRequest, url));
var responseStatus = xmlResponse.Element("Response").Element("Status").FirstNode.ToString();
var transactionId = xmlResponse.Element("Response").Element("Response").Element("TransactionID").FirstNode.ToString();
var transactionCode = xmlResponse.Element("Response").Element("Response").Element("Code").FirstNode.ToString();
var bankUrl = HttpUtility.HtmlDecode(xmlResponse.Element("Response").Element("Response").Element("BankURL").FirstNode.ToString());
orderInfo.PaymentInfo.Url = bankUrl;
PaymentProviderHelper.SetTransactionId(orderInfo, transactionId); //transactionCode hierin verwerken??
//IO.Container.Resolve<IOrderUpdatingService>().AddCustomerFields(order, new Dictionary<string, string>({ "extraBilling", value }), CustomerDatatypes.Extra);
orderInfo.AddCustomerFields(new Dictionary<string, string> { { "extraTransactionCode", transactionCode } }, Common.CustomerDatatypes.Extra);
orderInfo.Save();
return new PaymentRequest();
}