• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IPaymentGatewayMethod类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IPaymentGatewayMethod的典型用法代码示例。如果您正苦于以下问题:C# IPaymentGatewayMethod类的具体用法?C# IPaymentGatewayMethod怎么用?C# IPaymentGatewayMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IPaymentGatewayMethod类属于命名空间,在下文中一共展示了IPaymentGatewayMethod类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: 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);

            var result = invoice.AuthorizePayment(paymentGatewayMethod, args);

            Finalizing.RaiseEvent(new SalesPreparationEventArgs<IPaymentResult>(result), this);

            return result;
        }
开发者ID:arknu,项目名称:Merchello,代码行数:23,代码来源:SalePreparationBase.cs


示例17: Init

        public void Init()
        {
            var billTo = new Address()
            {
                Organization = "Proworks",
                Address1 = "777 NE 2nd St.",
                Locality = "Corvallis",
                Region = "OR",
                PostalCode = "97330",
                CountryCode = "US",
                Email = "[email protected]",
                Phone = "555-555-5555"
            };

            // create an invoice
            var invoiceService = new InvoiceService();

            _invoice = invoiceService.CreateInvoice(Core.Constants.DefaultKeys.InvoiceStatus.Unpaid);
                                                  
            var extendedData = new ExtendedDataCollection();

            // this is typically added automatically in the checkout workflow
            extendedData.SetValue(Core.Constants.ExtendedDataKeys.CurrencyCode, "USD");

            var processorSettings = new ChaseProcessorSettings
            {
                MerchantId = ConfigurationManager.AppSettings["merchantId"],
                Bin = ConfigurationManager.AppSettings["bin"],
                Username = ConfigurationManager.AppSettings["username"],
                Password = ConfigurationManager.AppSettings["password"]
            };

            Provider.GatewayProviderSettings.ExtendedData.SaveProcessorSettings(processorSettings);

            if (Provider.PaymentMethods.Any()) return;
            var resource = new GatewayResource("CreditCard", "Credit Card");
            _payment = Provider.CreatePaymentMethod(resource, "Credit Card", "Credit Card");
        }
开发者ID:drpeck,项目名称:Merchello,代码行数:38,代码来源:ChaseProcessorTests.cs


示例18: Build

        private void Build(PaymentRequest request)
        {
            _invoice = _merchelloContext.Services.InvoiceService.GetByKey(request.InvoiceKey);

            if (request.PaymentKey != null)
                _payment = _merchelloContext.Services.PaymentService.GetByKey(request.PaymentKey.Value);

            _paymentGatewayMethod =
                _merchelloContext.Gateways.Payment.GetPaymentGatewayMethodByKey(request.PaymentMethodKey);

            _amount = request.Amount;

            foreach (var arg in request.ProcessorArgs)
            {
                _args.Add(arg.Key, arg.Value);
            }
        }
开发者ID:kedde,项目名称:Merchello,代码行数:17,代码来源:PaymentProcessor.cs


示例19: Initialize

        /// <summary>
        /// Initializes "this" object
        /// </summary>
        /// <param name="request">
        /// The incoming <see cref="PaymentRequestDisplay"/>
        /// </param>
        private void Initialize(PaymentRequestDisplay request)
        {
            this._invoice = this._merchelloContext.Services.InvoiceService.GetByKey(request.InvoiceKey);

            if (request.PaymentKey != null)
                this._payment = this._merchelloContext.Services.PaymentService.GetByKey(request.PaymentKey.Value);

            this._paymentGatewayMethod =
                this._merchelloContext.Gateways.Payment.GetPaymentGatewayMethodByKey(request.PaymentMethodKey);

            this._amount = request.Amount;

            foreach (var arg in request.ProcessorArgs)
            {
                this._args.Add(arg.Key, arg.Value);
            }
        }
开发者ID:drpeck,项目名称:Merchello,代码行数:23,代码来源:PaymentProcessor.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IPaymentMethod类代码示例发布时间:2022-05-24
下一篇:
C# IPayment类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap