本文整理汇总了C#中IPaymentGatewayMethod类的典型用法代码示例。如果您正苦于以下问题:C# IPaymentGatewayMethod类的具体用法?C# IPaymentGatewayMethod怎么用?C# IPaymentGatewayMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPaymentGatewayMethod类属于命名空间,在下文中一共展示了IPaymentGatewayMethod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AuthorizeCapturePayment
/// <summary>
/// Authorizes and Captures a Payment
/// </summary>
/// <param name="invoice">The <see cref="IInvoice"/></param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentMethod"/></param>
/// <param name="args">Additional arguements required by the payment processor</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public static IPaymentResult AuthorizeCapturePayment(this IInvoice invoice,
IPaymentGatewayMethod paymentGatewayMethod, ProcessorArgumentCollection args)
{
Mandate.ParameterNotNull(paymentGatewayMethod, "paymentGatewayMethod");
return paymentGatewayMethod.AuthorizeCapturePayment(invoice, invoice.Total, args);
}
示例2: AuthorizePayment
/// <summary>
/// Attempts to authorize a payment
/// </summary>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/> to use in processing the payment</param>
/// <param name="args">Additional arguments required by the payment processor</param>
/// <returns>The <see cref="IPaymentResult"/></returns>
public override IPaymentResult AuthorizePayment(IPaymentGatewayMethod paymentGatewayMethod, ProcessorArgumentCollection args)
{
var result = base.AuthorizePayment(paymentGatewayMethod, args);
if (result.Payment.Success) Customer.Basket().Empty();
return result;
}
示例3: AuthorizeCapturePayment
/// <summary>
/// Authorizes and Captures a Payment
/// </summary>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentMethod"/></param>
/// <param name="args">Additional arguments required by the payment processor</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public override IPaymentResult AuthorizeCapturePayment(IPaymentGatewayMethod paymentGatewayMethod, ProcessorArgumentCollection args)
{
Mandate.ParameterNotNull(paymentGatewayMethod, "paymentGatewayMethod");
if (!this.IsReadyToInvoice()) return new PaymentResult(Attempt<IPayment>.Fail(new InvalidOperationException("SalesPreparation is not ready to invoice")), null, false);
// invoice
var invoice = this.PrepareInvoice(this.InvoiceBuilder);
this.Context.Services.InvoiceService.Save(invoice);
var result = invoice.AuthorizeCapturePayment(paymentGatewayMethod, args);
if (result.Payment.Success && this.Context.Settings.EmptyBasketOnPaymentSuccess) this.Context.Customer.Basket().Empty();
this.OnFinalizing(result);
return result;
}
示例4: AuthorizeCapturePayment
/// <summary>
/// Authorizes and Captures a Payment
/// </summary>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentMethod"/></param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public abstract IPaymentResult AuthorizeCapturePayment(IPaymentGatewayMethod paymentGatewayMethod);
示例5: RefundPayment
/// <summary>
/// Refunds a payment
/// </summary>
/// <param name="invoice">The invoice to be the payment was applied</param>
/// <param name="payment">The payment to be refunded</param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/></param>
/// <param name="amount">The amount to be refunded</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public static IPaymentResult RefundPayment(this IInvoice invoice, IPayment payment,
IPaymentGatewayMethod paymentGatewayMethod, decimal amount)
{
return invoice.RefundPayment(payment, paymentGatewayMethod, amount, new ProcessorArgumentCollection());
}
示例6: AuthorizePayment
/// <summary>
/// Attempts to process a payment
/// </summary>
/// <param name="invoice">The <see cref="IInvoice"/></param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/> to use in processing the payment</param>
/// <returns>The <see cref="IPaymentResult"/></returns>
public static IPaymentResult AuthorizePayment(this IInvoice invoice,
IPaymentGatewayMethod paymentGatewayMethod)
{
Mandate.ParameterCondition(invoice.HasIdentity,
"The invoice must be saved before a payment can be authorized.");
Mandate.ParameterNotNull(paymentGatewayMethod, "paymentGatewayMethod");
return invoice.AuthorizePayment(paymentGatewayMethod, new ProcessorArgumentCollection());
}
示例7: AuthorizePayment
/// <summary>
/// Attempts to process a payment
/// </summary>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/> to use in processing the payment</param>
/// <param name="args">Additional arguments required by the payment processor</param>
/// <returns>The <see cref="IPaymentResult"/></returns>
public virtual IPaymentResult AuthorizePayment(IPaymentGatewayMethod paymentGatewayMethod, ProcessorArgumentCollection args)
{
Mandate.ParameterNotNull(paymentGatewayMethod, "paymentGatewayMethod");
if (!IsReadyToInvoice()) return new PaymentResult(Attempt<IPayment>.Fail(new InvalidOperationException("SalesPreparation is not ready to invoice")), null, false);
// invoice
var invoice = PrepareInvoice(new InvoiceBuilderChain(this));
MerchelloContext.Services.InvoiceService.Save(invoice);
////TODO
//// Raise the notification event
//// Announce.Broadcast.InvoicedCustomer(_customer, invoice);
var result = invoice.AuthorizePayment(paymentGatewayMethod, args);
////if(result.Payment.Success)
//// Announce.Broadcast.PaymentWasAuthorized(_customer, result);
if (!result.ApproveOrderCreation) return result;
// order
var order = result.Invoice.PrepareOrder(MerchelloContext);
MerchelloContext.Services.OrderService.Save(order);
return result;
}
示例8: VoidPayment
/// <summary>
/// Voids a payment
/// </summary>
/// <param name="invoice">The invoice to be the payment was applied</param>
/// <param name="payment">The payment to be voided</param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/></param>
/// <param name="args">Additional arguements required by the payment processor</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public static IPaymentResult VoidPayment(this IPayment payment, IInvoice invoice,
IPaymentGatewayMethod paymentGatewayMethod, ProcessorArgumentCollection args)
{
return paymentGatewayMethod.VoidPayment(invoice, payment, args);
}
示例9: RefundPayment
/// <summary>
/// Refunds a payment
/// </summary>
/// <param name="invoice">The invoice to be the payment was applied</param>
/// <param name="payment">The payment to be refunded</param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/></param>
/// <returns>A <see cref="IPaymentResult"/></returns>
internal static IPaymentResult RefundPayment(this IInvoice invoice, IPayment payment,
IPaymentGatewayMethod paymentGatewayMethod)
{
return invoice.RefundPayment(payment, paymentGatewayMethod, new ProcessorArgumentCollection());
}
示例10: CapturePayment
/// <summary>
/// Captures a payment for the <see cref="IInvoice"/>
/// </summary>
/// <param name="invoice">The invoice to be payed</param>
/// <param name="payment">The</param>
/// <param name="amount">The amount to the payment to be captured</param>
/// <param name="paymentGatewayMethod"></param>
/// <returns>A <see cref="IPaymentResult"/></returns>
internal static IPaymentResult CapturePayment(this IInvoice invoice, IPayment payment,
IPaymentGatewayMethod paymentGatewayMethod, decimal amount)
{
return invoice.CapturePayment(payment, paymentGatewayMethod, amount, new ProcessorArgumentCollection());
}
示例11: RefundPayment
/// <summary>
/// Refunds a payment
/// </summary>
/// <param name="invoice">The invoice to be the payment was applied</param>
/// <param name="payment">The payment to be refunded</param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/></param>
/// <param name="amount">The amount to be refunded</param>
/// <param name="args">Additional arguements required by the payment processor</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public static IPaymentResult RefundPayment(this IPayment payment, IInvoice invoice, IPaymentGatewayMethod paymentGatewayMethod, decimal amount, ProcessorArgumentCollection args)
{
return paymentGatewayMethod.RefundPayment(invoice, payment, amount, args);
}
示例12: CapturePayment
/// <summary>
/// Captures a payment for the <see cref="IInvoice"/>
/// </summary>
/// <param name="invoice">The invoice to be payed</param>
/// <param name="payment">The</param>
/// <param name="amount">The amount to the payment to be captured</param>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentGatewayMethod"/> to process the payment</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public static IPaymentResult CapturePayment(this IPayment payment, IInvoice invoice, IPaymentGatewayMethod paymentGatewayMethod, decimal amount)
{
return payment.CapturePayment(invoice, paymentGatewayMethod, amount, new ProcessorArgumentCollection());
}
示例13: DeletePaymentMethod
/// <summary>
/// Deletes a <see cref="IPaymentGatewayMethod"/>
/// </summary>
/// <param name="method">The <see cref="IPaymentGatewayMethod"/> to delete</param>
public virtual void DeletePaymentMethod(IPaymentGatewayMethod method)
{
GatewayProviderService.Save(method.PaymentMethod);
}
示例14: SavePaymentMethod
/// <summary>
/// Saves a <see cref="IPaymentGatewayMethod"/>
/// </summary>
/// <param name="method">The <see cref="IPaymentGatewayMethod"/> to be saved</param>
public virtual void SavePaymentMethod(IPaymentGatewayMethod method)
{
GatewayProviderService.Save(method.PaymentMethod);
PaymentMethods = null;
}
示例15: AuthorizeCapturePayment
/// <summary>
/// Authorizes and Captures a Payment
/// </summary>
/// <param name="paymentGatewayMethod">The <see cref="IPaymentMethod"/></param>
/// <param name="args">Additional arguements required by the payment processor</param>
/// <returns>A <see cref="IPaymentResult"/></returns>
public virtual IPaymentResult AuthorizeCapturePayment(IPaymentGatewayMethod paymentGatewayMethod, ProcessorArgumentCollection args)
{
Mandate.ParameterNotNull(paymentGatewayMethod, "paymentGatewayMethod");
if (!IsReadyToInvoice()) return new PaymentResult(Attempt<IPayment>.Fail(new InvalidOperationException("SalesPreparation is not ready to invoice")), null, false);
// invoice
var invoice = PrepareInvoice(new InvoiceBuilderChain(this));
MerchelloContext.Services.InvoiceService.Save(invoice);
var result = invoice.AuthorizeCapturePayment(paymentGatewayMethod, args);
if (!result.ApproveOrderCreation) return result;
// order
var order = result.Invoice.PrepareOrder(MerchelloContext);
MerchelloContext.Services.OrderService.Save(order);
return result;
}