/// <summary> /// Attempts to process a payment /// </summary> /// <param name="invoice">The <see cref="IInvoice"/></param> /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param> /// <param name="paymentMethodKey">The <see cref="IPaymentMethod"/> key</param> /// <param name="args">Additional arguements required by the payment processor</param> /// <returns>The <see cref="IPaymentResult"/></returns> internal static IPaymentResult AuthorizePayment(this IInvoice invoice, IMerchelloContext merchelloContext, Guid paymentMethodKey, ProcessorArgumentCollection args) { var paymentMethod = merchelloContext.Gateways.Payment.GetPaymentGatewayMethodByKey(paymentMethodKey); return invoice.AuthorizePayment(paymentMethod, args); }
/// <summary> /// Attempts to process a payment /// </summary> /// <param name="invoice"></param> /// <param name="paymentMethodKey">The <see cref="IPaymentMethod"/> key</param> /// <param name="args">Additional arguements required by the payment processor</param> /// <returns>The <see cref="IPaymentResult"/></returns> public static IPaymentResult AuthorizePayment(this IInvoice invoice, Guid paymentMethodKey, ProcessorArgumentCollection args) { return invoice.AuthorizePayment(MerchelloContext.Current, paymentMethodKey, args); }
/// <summary> /// Attempts to process a payment /// </summary> /// <param name="invoice">The <see cref="IInvoice"/></param> /// <param name="paymentMethodKey">The <see cref="IPaymentMethod"/> key</param> /// <returns>The <see cref="IPaymentResult"/></returns> public static IPaymentResult AuthorizePayment(this IInvoice invoice, Guid paymentMethodKey) { return invoice.AuthorizePayment(paymentMethodKey, new ProcessorArgumentCollection()); }
/// <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()); }