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


C# IPaymentGatewayMethod类代码示例

本文整理汇总了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);
        }
开发者ID:ProNotion,项目名称:Merchello,代码行数:14,代码来源:InvoiceExtensions.cs

示例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;
        }
开发者ID:arknu,项目名称:Merchello,代码行数:14,代码来源:BasketSalePreparation.cs

示例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;
        }
开发者ID:Teknyc,项目名称:Merchello,代码行数:25,代码来源:BasketCheckoutPaymentManager.cs

示例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);
开发者ID:Teknyc,项目名称:Merchello,代码行数:6,代码来源:CheckoutPaymentManagerBase.cs

示例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());
 }
开发者ID:ProNotion,项目名称:Merchello,代码行数:13,代码来源:InvoiceExtensions.cs

示例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());
        }
开发者ID:ProNotion,项目名称:Merchello,代码行数:15,代码来源:InvoiceExtensions.cs

示例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;
        }
开发者ID:kedde,项目名称:Merchello,代码行数:35,代码来源:SalePreparationBase.cs

示例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);
 }
开发者ID:arknu,项目名称:Merchello,代码行数:13,代码来源:PaymentExtensions.cs

示例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());
 }
开发者ID:naepalm,项目名称:Merchello,代码行数:12,代码来源:InvoiceExtensions.cs

示例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());
 }
开发者ID:naepalm,项目名称:Merchello,代码行数:13,代码来源:InvoiceExtensions.cs

示例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);
 }
开发者ID:arknu,项目名称:Merchello,代码行数:13,代码来源:PaymentExtensions.cs

示例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());
 }
开发者ID:arknu,项目名称:Merchello,代码行数:12,代码来源:PaymentExtensions.cs

示例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);
 }
开发者ID:koswesley,项目名称:Merchello-1,代码行数:8,代码来源:PaymentGatewayProviderBase.cs

示例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;
        }
开发者ID:koswesley,项目名称:Merchello-1,代码行数:10,代码来源:PaymentGatewayProviderBase.cs

示例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;
        }
开发者ID:BatJan,项目名称:Merchello,代码行数:28,代码来源:SalePreparationBase.cs


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