コード例 #1
0
 public static void DisableAutoDetectChanges(this IPaymentContext context, bool disable = true)
 {
     if (context is DbContext dbContext)
     {
         dbContext.ChangeTracker.AutoDetectChangesEnabled = !disable;
     }
 }
コード例 #2
0
 public DataPushService(IPaymentContext context, IXrmService xrmService, ILogger logger)
 {
     this.logger     = logger;
     this.context    = context;
     this.xrmService = xrmService;
     this.entityType = new List <Type>();
 }
コード例 #3
0
 public GetPaymentHandler(
     IMapper mapper,
     IPaymentContext context)
 {
     _mapper  = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
コード例 #4
0
 public CreatePayments(IPaymentProcessorGateway gateway, IPaymentContext db, ILogger <CreatePayments> logger, IOptions <TestDataOption> options)
 {
     this.logger  = logger;
     this.gateway = gateway;
     this.db      = db;
     this.option  = options.Value;
 }
コード例 #5
0
 public ProductService(ICommerceContext commerceContext, IUserManager <GearUser> userManager, IPaymentContext paymentContext, IOrderDbContext orderDbContext)
 {
     Context         = commerceContext;
     _userManager    = userManager;
     _paymentContext = paymentContext;
     _orderDbContext = orderDbContext;
 }
コード例 #6
0
 public SendPaymentRequestHandler(
     IBankingService bankingService,
     IMapper mapper,
     IPaymentContext context)
 {
     _bankingService = bankingService ?? throw new ArgumentNullException(nameof(bankingService));
     _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _context        = context ?? throw new ArgumentNullException(nameof(context));
 }
コード例 #7
0
        internal GatewayContext(IShippingContext shipping, ITaxationContext taxation, IPaymentContext payment)
        {
            Mandate.ParameterNotNull(shipping, "shipping");
            Mandate.ParameterNotNull(taxation, "taxation");
            Mandate.ParameterNotNull(payment, "payment");

            _shipping = shipping;
            _taxation = taxation;
            _payment = payment;
        }
コード例 #8
0
 public CrmReportService(
     IUserManager <GearUser> userManager,
     ITaskManagerContext taskManagerContext,
     ILeadContext <Lead> leadContext, IPaymentContext paymentContext)
 {
     //_context = context;
     _userManager        = userManager;
     _taskManagerContext = taskManagerContext;
     _leadContext        = leadContext;
     _paymentContext     = paymentContext;
 }
コード例 #9
0
        internal static EventProduct GetEventProductFromId(Guid entityId, IPaymentContext context)
        {
            var eventProduct = context.EventProduct.FirstOrDefault(ep => ep.EventProductId == entityId);

            if (eventProduct == null)
            {
                throw new Exception("Could not find Event Product  with Id:" + entityId);
            }

            return(eventProduct);
        }
コード例 #10
0
        internal static EventSponsorship GetEventSponsorshipFromId(Guid entityId, IPaymentContext context)
        {
            var eventSponsorship = context.EventSponsorship.FirstOrDefault(es => es.EventSponsorshipId == entityId);

            if (eventSponsorship == null)
            {
                throw new Exception("Could not find Event Sponsorship  with Id:" + entityId);
            }

            return(eventSponsorship);
        }
コード例 #11
0
 public PaymentService(IPaymentContext context,
                       IMapper mapper,
                       ICrmOrganizationService organizationService,
                       IProductService productService,
                       INotify <GearRole> notifyService)
 {
     _context             = context;
     _mapper              = mapper;
     _organizationService = organizationService;
     _productService      = productService;
     _notifyService       = notifyService;
 }
コード例 #12
0
        public static async Task SaveChangesAsync(this IPaymentContext context, TimeSpan timeout, CancellationToken token = default)
        {
            if (context is DbContext dbContext)
            {
                var tempTimeout = dbContext.Database.GetCommandTimeout();
                dbContext.Database.SetCommandTimeout(timeout);
                await dbContext.SaveChangesAsync(token);

                dbContext.Database.SetCommandTimeout(tempTimeout);
            }
            else
            {
                await context.SaveChangesAsync(token);
            }
        }
コード例 #13
0
        internal static List <EventPackage> GetEventPackagesFromEventTicket(EventTicket eventTicket, IPaymentContext context)
        {
            var eventPackages = new List <EventPackage>();

            // get the list of all Tickets associated with this record
            var tickets = context.Ticket.Where(t => t.EventTicketId == eventTicket.EvenTicketId && t.StateCode == 0).ToList();

            // get Event Packages from the Tickets
            foreach (var curTicket in tickets)
            {
                if (curTicket.EventPackageId.HasValue)
                {
                    var curEventPackages =
                        context.EventPackage.Where(e => e.EventPackageId == curTicket.EventPackageId && e.StateCode == 0).Distinct().ToList();
                    eventPackages.AddRange(curEventPackages);
                }
            }
            return(eventPackages);
        }
コード例 #14
0
 public PaymentRepository(IPaymentContext context)
 {
     _context = context;
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentGatewayApiController"/> class.
 /// </summary>
 /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param>
 public PaymentGatewayApiController(MerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _paymentContext = MerchelloContext.Gateways.Payment;
 }
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentGatewayApiController"/> class.
 /// </summary>
 /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param>
 public PaymentGatewayApiController(IMerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _paymentContext = MerchelloContext.Gateways.Payment;
 }
コード例 #17
0
 public PaymentRepoService(IPaymentContext context)
 {
     this.context = context;
     this.context.DisableAutoDetectChanges();
 }
コード例 #18
0
 public PaymentCodeService(IPaymentContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
コード例 #19
0
        internal static List <EventPackage> GetEventPackagesFromEventSponsorship(EventSponsorship eventSponsorship, IPaymentContext context)
        {
            var eventPackages = new List <EventPackage>();

            // get the list of all Sponsorships associated with this record
            var sponsorships = context.Sponsorship.Where(t => t.EventSponsorshipId == eventSponsorship.EventSponsorshipId && t.StateCode == 0).ToList();

            // get Event Packages from the Products
            foreach (var curSponsorship in sponsorships)
            {
                if (curSponsorship.EventPackageId.HasValue)
                {
                    var curEventPackages =
                        context.EventPackage.Where(e => e.EventPackageId == curSponsorship.EventPackageId && e.StateCode == 0).Distinct().ToList();
                    eventPackages.AddRange(curEventPackages);
                }
            }
            return(eventPackages);
        }
コード例 #20
0
ファイル: PaymentService.cs プロジェクト: sjefvanleeuwen/GEAR
 public PaymentService(IPaymentContext paymentContext, IOrderProductService <Order> orderProductService)
 {
     _paymentContext      = paymentContext;
     _orderProductService = orderProductService;
 }
コード例 #21
0
 public PaymentController(IPaymentContext paymentManager, IOrderManager orderManager)
 {
     _paymentContext = paymentManager;
     _orderManager   = orderManager;
 }