本文整理汇总了C#中ProcessorArgumentCollection.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessorArgumentCollection.ContainsKey方法的具体用法?C# ProcessorArgumentCollection.ContainsKey怎么用?C# ProcessorArgumentCollection.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessorArgumentCollection
的用法示例。
在下文中一共展示了ProcessorArgumentCollection.ContainsKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformAuthorizeCapturePayment
/// <summary>
/// Performs the actual work of authorizing and capturing a payment.
/// </summary>
/// <param name="invoice">
/// The invoice.
/// </param>
/// <param name="amount">
/// The amount.
/// </param>
/// <param name="args">
/// The args.
/// </param>
/// <returns>
/// The <see cref="IPaymentResult"/>.
/// </returns>
/// <remarks>
/// This is a transaction with SubmitForSettlement = true
/// </remarks>
protected override IPaymentResult PerformAuthorizeCapturePayment(IInvoice invoice, decimal amount, ProcessorArgumentCollection args)
{
var paymentMethodNonce = args.GetPaymentMethodNonce();
if (string.IsNullOrEmpty(paymentMethodNonce))
{
var error = new InvalidOperationException("No payment method nonce was found in the ProcessorArgumentCollection");
LogHelper.Debug<BraintreeStandardTransactionPaymentGatewayMethod>(error.Message);
return new PaymentResult(Attempt<IPayment>.Fail(error), invoice, false);
}
// TODO this is a total last minute hack
var email = string.Empty;
if (args.ContainsKey("customerEmail")) email = args["customerEmail"];
var attempt = this.ProcessPayment(invoice, TransactionOption.SubmitForSettlement, invoice.Total, paymentMethodNonce, email);
var payment = attempt.Payment.Result;
this.GatewayProviderService.Save(payment);
if (!attempt.Payment.Success)
{
this.GatewayProviderService.ApplyPaymentToInvoice(payment.Key, invoice.Key, AppliedPaymentType.Denied, attempt.Payment.Exception.Message, 0);
}
else
{
this.GatewayProviderService.ApplyPaymentToInvoice(payment.Key, invoice.Key, AppliedPaymentType.Debit, "Braintree PayPal one time transaction - authorized and captured", amount);
}
return attempt;
}