コード例 #1
0
ファイル: OrderService.cs プロジェクト: yperepelytsa/OOAD
 public OrderService(OrderFactory orderFactory, InvoiceFactory invoiceFactory, PaymentFactory paymentFactory, IOrderRepository orderRepo,
                     IPaymentRepository paymentRepo, IProductRepository productRepo, IInvoiceRepository invoiceRepo, IStripeApiService stripeService)
 {
     this._orderFactory   = orderFactory;
     this._invoiceFactory = invoiceFactory;
     this._paymentFactory = paymentFactory;
     this._orderRepo      = orderRepo;
     this._paymentRepo    = paymentRepo;
     this._productRepo    = productRepo;
     this._invoiceRepo    = invoiceRepo;
     this._stripeService  = stripeService;
 }
        public StripeApiController(IMerchelloContext merchelloContext)
        {
            if (merchelloContext == null)
            {
                throw new ArgumentNullException("merchelloContext");
            }
            var provider = (StripePaymentGatewayProvider)merchelloContext.Gateways.Payment.GetProviderByKey(Constants.Stripe.GatewayProviderSettingsKey);

            if (provider == null)
            {
                var ex = new NullReferenceException("The StripePaymentGatewayProvider could not be resolved.  The provider must be activiated");
                LogHelper.Error <StripeApiController>("StripePaymentGatewayProvider not activated.", ex);
                throw ex;
            }

            var settings = provider.ExtendedData.GetStripeProviderSettings();

            this._stripeApiService = new StripeApiService(merchelloContext, settings);
        }
        public StripePaymentGatewayMethod(IGatewayProviderService gatewayProviderService, IPaymentMethod paymentMethod, IStripeApiService stripeApiService)
            : base(gatewayProviderService, paymentMethod)
        {
            Mandate.ParameterNotNull(stripeApiService, "stripeApiService");

            this.StripeApiService = stripeApiService;
            this.Initialize();
        }