示例#1
0
        public ActionResult Details(Guid id)
        {
            IPaymentTransactionService tranSrv = IoC.Resolve <IPaymentTransactionService>();
            PaymentTransaction         model   = tranSrv.Getbykey(id);

            return(View(model));
        }
示例#2
0
 public ActionResult Upload(HttpPostedFileBase FilePath)
 {
     try
     {
         IPaymentTransactionService tranSrv = IoC.Resolve <IPaymentTransactionService>();
         Company currentCom = ((EInvoiceContext)FXContext.Current).CurrentCompany;
         if (FilePath != null && FilePath.ContentLength > 0)
         {
             byte[] bf = new byte[FilePath.ContentLength];
             FilePath.InputStream.Read(bf, 0, FilePath.ContentLength);
             if (!FilePath.FileName.ToLower().Contains(".xls"))
             {
                 Messages.AddErrorFlashMessage("File upload phải là file .xls hoặc .XLS!");
                 return(RedirectToAction("Upload"));
             }
             Guid guid = Guid.NewGuid();
             //thanh toan theo lo
             PaymentTransaction mTran = paymentViaBlock(bf);
             tranSrv.CreateNew(mTran);
             tranSrv.CommitChanges();
             Messages.AddFlashMessage("Upload file và gạch nợ xong, mã giao dịch: " + mTran.id);
             return(RedirectToAction("PaymentTransactionIndex"));
         }
         Messages.AddErrorFlashMessage("Chọn file cần upload!");
         return(RedirectToAction("Upload"));
     }
     catch (Exception ex)
     {
         Messages.AddErrorMessage("Có lỗi xảy ra, vui lòng kiểm tra log để biết thêm chi tiết.");
         return(View("Upload"));
     }
 }
示例#3
0
        public void Init()
        {
            var optionsBuilder = new DbContextOptionsBuilder <ApplicationDbContext>();

            optionsBuilder.UseInMemoryDatabase("databaseManagerService")
            .ConfigureWarnings(x => x.Ignore(InMemoryEventId.TransactionIgnoredWarning));
            context = new ApplicationDbContext(optionsBuilder.Options);

            paymentService = new PaymentTransactionService(Substitute.For <ILogger <IPaymentTransactionService> >(), context);

            user = new ApplicationUser
            {
                Id        = Guid.NewGuid(),
                IsEnabled = true,
                Wallets   = new List <Wallets> {
                    new Wallets {
                        Amount = 0, Currency = Currency.GVT
                    }
                },
                BlockchainAddresses = new List <BlockchainAddresses>
                {
                    new BlockchainAddresses {
                        Id = Guid.NewGuid(), Address = "0x00", Currency = Currency.GVT
                    }
                }
            };
            context.Add(user);
            context.SaveChanges();
        }
示例#4
0
 public OrderModelFactory(IModelMapper modelMapper, IFormatterService formatterService, IDataSerializer dataSerializer, IMediaAccountant mediaAccountant, IPaymentTransactionService paymentTransactionService)
 {
     _modelMapper               = modelMapper;
     _formatterService          = formatterService;
     _dataSerializer            = dataSerializer;
     _mediaAccountant           = mediaAccountant;
     _paymentTransactionService = paymentTransactionService;
 }
示例#5
0
 public PaymentTransactionsController(IPaymentTransactionService paymentTransactionService,
                                      IWalletService walletService,
                                      IConfiguration configuration)
 {
     _adminPassword             = configuration["Wallet:AdminPassword"];
     _walletService             = walletService;
     _paymentTransactionService = paymentTransactionService;
 }
示例#6
0
 public MarkAsAuthorizedCommandHandler(
     IOrderService orderService,
     IPaymentTransactionService paymentTransactionService,
     IMediator mediator)
 {
     _orderService = orderService;
     _paymentTransactionService = paymentTransactionService;
     _mediator = mediator;
 }
 public MarkAsPaidCommandHandler(
     IMediator mediator,
     IOrderService orderService,
     IPaymentTransactionService paymentTransactionService)
 {
     _mediator     = mediator;
     _orderService = orderService;
     _paymentTransactionService = paymentTransactionService;
 }
 public VoidOfflineCommandHandler(
     IOrderService orderService,
     IPaymentTransactionService paymentTransactionService,
     IMediator mediator)
 {
     _orderService = orderService;
     _paymentTransactionService = paymentTransactionService;
     _mediator = mediator;
 }
示例#9
0
 public DefaultPaymentAccountant(ILogger logger, IOrderService orderService, IPaymentTransactionService paymentTransactionService, ICartService cartService, IStoreCreditService storeCreditService, AffiliateSettings affiliateSettings)
 {
     _logger       = logger;
     _orderService = orderService;
     _paymentTransactionService = paymentTransactionService;
     _cartService        = cartService;
     _storeCreditService = storeCreditService;
     _affiliateSettings  = affiliateSettings;
 }
        public async Task Cleanup()
        {
            await RemoveAllWalletsAndTransactions();

            await _context.DisposeAsync();

            _unitOfWork                = null;
            _walletService             = null;
            _paymentTransactionService = null;
        }
        public void Setup()
        {
            var dbContextFactory    = new SampleDbContextFactory();
            var bankAPIDeterminator = new BankAPIDeterminator();

            _context                   = dbContextFactory.CreateDbContext(new string[] { });
            _unitOfWork                = new EfCoreUnitOfWork(_context);
            _walletService             = new WalletService(_unitOfWork, bankAPIDeterminator);
            _paymentTransactionService = new ApplicationServices.PaymentTransactionService(_unitOfWork, bankAPIDeterminator);
        }
        public PaymentWcfService()
        {
            var moduleBuilder = new ServiceModuleBuilder
                (new List<ServiceModule>
                {
                    new PaymentServiceModule(),
                    new LoggingServiceModule()
                });

            moduleBuilder.Build();
            _paymentTransactionService = moduleBuilder.Container.Resolve<IPaymentTransactionService>();
        }
示例#13
0
        public PaymentWcfService()
        {
            var moduleBuilder = new ServiceModuleBuilder
                                    (new List <ServiceModule>
            {
                new PaymentServiceModule(),
                new LoggingServiceModule()
            });

            moduleBuilder.Build();
            _paymentTransactionService = moduleBuilder.Container.Resolve <IPaymentTransactionService>();
        }
 public CaptureCommandHandler(
     IPaymentService paymentService,
     IPaymentTransactionService paymentTransaction,
     IMediator mediator,
     IOrderService orderService,
     ILogger logger)
 {
     _paymentService     = paymentService;
     _paymentTransaction = paymentTransaction;
     _mediator           = mediator;
     _orderService       = orderService;
     _logger             = logger;
 }
示例#15
0
 public VoidCommandHandler(
     IOrderService orderService,
     IMediator mediator,
     IPaymentService paymentService,
     IPaymentTransactionService paymentTransactionService,
     ILogger logger)
 {
     _orderService              = orderService;
     _mediator                  = mediator;
     _paymentService            = paymentService;
     _paymentTransactionService = paymentTransactionService;
     _logger = logger;
 }
示例#16
0
 public RefundOfflineCommandHandler(
     IMediator mediator,
     IOrderService orderService,
     IPaymentTransactionService paymentTransactionService,
     IMessageProviderService messageProviderService,
     LanguageSettings languageSettings)
 {
     _mediator     = mediator;
     _orderService = orderService;
     _paymentTransactionService = paymentTransactionService;
     _messageProviderService    = messageProviderService;
     _languageSettings          = languageSettings;
 }
示例#17
0
        public void Completed(Guid id)
        {
            IPaymentTransactionService tranSrv = IoC.Resolve <IPaymentTransactionService>();
            PaymentTransaction         model   = tranSrv.Getbykey(id);

            byte[] buffer = model.CompleteResult;
            if (buffer == null)
            {
                return;
            }
            Response.ContentType = "text/plain";
            Response.OutputStream.Write(buffer, 0, buffer.Length);
            Response.AddHeader("Content-Disposition", "attachment;filename=gachno.xls");
            return;
        }
 public PartiallyRefundCommandHandler(
     IPaymentService paymentService,
     IPaymentTransactionService paymentTransactionService,
     IMediator mediator,
     IMessageProviderService messageProviderService,
     ILogger logger,
     IOrderService orderService,
     LanguageSettings languageSettings)
 {
     _paymentService            = paymentService;
     _paymentTransactionService = paymentTransactionService;
     _orderService           = orderService;
     _mediator               = mediator;
     _messageProviderService = messageProviderService;
     _logger           = logger;
     _languageSettings = languageSettings;
 }
示例#19
0
 public ActionResult Delete(Guid id)
 {
     try
     {
         IPaymentTransactionService tranSrv = IoC.Resolve <IPaymentTransactionService>();
         PaymentTransaction         model   = tranSrv.Getbykey(id);
         tranSrv.Delete(model);
         tranSrv.CommitChanges();
         log.Info("Delete PaymentTransaction Einvoices by: " + HttpContext.User.Identity.Name + " Info-- GUID: " + id.ToString());
         Messages.AddFlashMessage("Xóa thành công!");
     }
     catch (Exception ex)
     {
         log.Error(" Delete -" + ex);
         Messages.AddErrorFlashMessage("Có lỗi xảy ra, vui lòng thực hiện lại!");
     }
     return(RedirectToAction("PaymentTransactionIndex"));
 }
示例#20
0
 public PaymentController(IUserPaymentMethodService paymentMethodService, 
     IPaymentProcessingService paymentProcessingService, 
     ICryptographyService cryptographyService, 
     IVideoBattleService videoBattleService, 
     ISponsorService sponsorService, 
     ICreditService creditService, 
     PaymentSettings paymentSettings, 
     IPaymentTransactionService paymentTransactionService)
 {
     _paymentMethodService = paymentMethodService;
     _paymentProcessingService = paymentProcessingService;
     _cryptographyService = cryptographyService;
     _videoBattleService = videoBattleService;
     _sponsorService = sponsorService;
     _creditService = creditService;
     _paymentSettings = paymentSettings;
     _paymentTransactionService = paymentTransactionService;
 }
示例#21
0
 public OrderController(IOrderService orderService,
                        IWorkContext workContext,
                        IPaymentService paymentService,
                        IPaymentTransactionService paymentTransactionService,
                        ITranslationService translationService,
                        IGroupService groupService,
                        IMediator mediator,
                        OrderSettings orderSettings)
 {
     _orderService              = orderService;
     _workContext               = workContext;
     _paymentService            = paymentService;
     _paymentTransactionService = paymentTransactionService;
     _translationService        = translationService;
     _groupService              = groupService;
     _mediator      = mediator;
     _orderSettings = orderSettings;
 }
 public PaymentController(IUserPaymentMethodService paymentMethodService,
                          IPaymentProcessingService paymentProcessingService,
                          ICryptographyService cryptographyService,
                          IVideoBattleService videoBattleService,
                          ISponsorService sponsorService,
                          ICreditService creditService,
                          PaymentSettings paymentSettings,
                          IPaymentTransactionService paymentTransactionService)
 {
     _paymentMethodService      = paymentMethodService;
     _paymentProcessingService  = paymentProcessingService;
     _cryptographyService       = cryptographyService;
     _videoBattleService        = videoBattleService;
     _sponsorService            = sponsorService;
     _creditService             = creditService;
     _paymentSettings           = paymentSettings;
     _paymentTransactionService = paymentTransactionService;
 }
示例#23
0
 public PaymentTransactionController(
     IPaymentService paymentService,
     ITranslationService translationService,
     IPaymentTransactionService paymentTransactionService,
     IOrderService orderService,
     IWorkContext workContext,
     IGroupService groupService,
     IDateTimeService dateTimeService,
     IMediator mediator
     )
 {
     _paymentService            = paymentService;
     _translationService        = translationService;
     _paymentTransactionService = paymentTransactionService;
     _orderService    = orderService;
     _workContext     = workContext;
     _groupService    = groupService;
     _dateTimeService = dateTimeService;
     _mediator        = mediator;
 }
示例#24
0
 public PaymentPayPalStandardController(
     IWorkContext workContext,
     IPaymentService paymentService,
     IOrderService orderService,
     ILogger logger,
     IMediator mediator,
     IPaymentTransactionService paymentTransactionService,
     IPaypalHttpClient paypalHttpClient,
     PayPalStandardPaymentSettings payPalStandardPaymentSettings,
     PaymentSettings paymentSettings)
 {
     _workContext                   = workContext;
     _paymentService                = paymentService;
     _orderService                  = orderService;
     _logger                        = logger;
     _mediator                      = mediator;
     _paymentTransactionService     = paymentTransactionService;
     _paypalHttpClient              = paypalHttpClient;
     _payPalStandardPaymentSettings = payPalStandardPaymentSettings;
     _paymentSettings               = paymentSettings;
 }
示例#25
0
 public ActionResult PaymentTransactionIndex(PaymentTransactionIndexModels model, int?page, int?pagesize)
 {
     try
     {
         int     defautPagesize             = pagesize.HasValue ? pagesize.Value : 10;
         int     currentPageIndex           = page.HasValue ? page.Value - 1 : 0;
         int     totalRecords               = 0;
         Company currentCom                 = ((EInvoiceContext)FXContext.Current).CurrentCompany;
         IPaymentTransactionService tranSrv = IoC.Resolve <IPaymentTransactionService>();
         Guid gID = Guid.Empty;
         try
         {
             gID = !string.IsNullOrEmpty(model.key) ? Guid.Parse(model.key.Trim()) : Guid.Empty;
         }
         catch (Exception ex)
         {
             gID = Guid.NewGuid();
             log.Error("Error:" + ex.Message);
             Messages.AddErrorMessage("Vui lòng nhập đúng mã giao dịch!");
         }
         DateTime?DateFrom = null;
         DateTime?DateTo   = null;
         if (!string.IsNullOrWhiteSpace(model.FromDate))
         {
             DateFrom = DateTime.ParseExact(model.FromDate, "dd/MM/yyyy", null);
         }
         if (!string.IsNullOrWhiteSpace(model.ToDate))
         {
             DateTo = DateTime.ParseExact(model.ToDate, "dd/MM/yyyy", null);
         }
         IList <PaymentTransaction> lst = tranSrv.GetByFilter(gID, currentCom.id, model.status, model.accountName, DateFrom, DateTo, currentPageIndex, defautPagesize, out totalRecords);
         model.PagedListTransaction = new PagedList <PaymentTransaction>(lst, currentPageIndex, defautPagesize, totalRecords);
     }
     catch (Exception ex)
     {
         log.Error("Error:" + ex);
         Messages.AddErrorMessage("Không có giao dịch trong hệ thống");
     }
     return(View(model));
 }
 public GetOrderDetailsHandler(
     IDateTimeService dateTimeService,
     IProductService productService,
     IProductAttributeParser productAttributeParser,
     ITranslationService translationService,
     IShipmentService shipmentService,
     IPaymentService paymentService,
     IPaymentTransactionService paymentTransactionService,
     IPriceFormatter priceFormatter,
     IGiftVoucherService giftVoucherService,
     IOrderService orderService,
     IPictureService pictureService,
     IDownloadService downloadService,
     IOrderStatusService orderStatusService,
     IMediator mediator,
     CatalogSettings catalogSettings,
     OrderSettings orderSettings,
     PdfSettings pdfSettings,
     TaxSettings taxSettings)
 {
     _dateTimeService           = dateTimeService;
     _productService            = productService;
     _productAttributeParser    = productAttributeParser;
     _translationService        = translationService;
     _shipmentService           = shipmentService;
     _paymentService            = paymentService;
     _paymentTransactionService = paymentTransactionService;
     _priceFormatter            = priceFormatter;
     _giftVoucherService        = giftVoucherService;
     _orderService       = orderService;
     _pictureService     = pictureService;
     _downloadService    = downloadService;
     _orderStatusService = orderStatusService;
     _mediator           = mediator;
     _orderSettings      = orderSettings;
     _catalogSettings    = catalogSettings;
     _pdfSettings        = pdfSettings;
     _taxSettings        = taxSettings;
 }
示例#27
0
        public void Download(Guid id)
        {
            IPaymentTransactionService tranSrv = IoC.Resolve <IPaymentTransactionService>();
            PaymentTransaction         model   = tranSrv.Getbykey(id);

            if (model == null)
            {
                Response.Clear();
                Response.Write("<script type='text/javascript'>alert('Có lỗi xảy ra, vui lòng thực hiện lại!')</script>");
                Response.End();
                Response.Flush();
            }
            byte[] buffer = model.FailResult;
            if (buffer == null)
            {
                return;
            }
            Response.ContentType = "text/plain";
            Response.OutputStream.Write(buffer, 0, buffer.Length);
            Response.AddHeader("Content-Disposition", "attachment;filename=gachnofailes.xls");
            return;
        }
 public CancelOrderCommandHandler(
     IMediator mediator,
     IOrderService orderService,
     IShipmentService shipmentService,
     IProductService productService,
     IInventoryManageService inventoryManageService,
     IProductReservationService productReservationService,
     IAuctionService auctionService,
     IDiscountService discountService,
     IPaymentService paymentService,
     IPaymentTransactionService paymentTransactionService)
 {
     _mediator                  = mediator;
     _orderService              = orderService;
     _shipmentService           = shipmentService;
     _productService            = productService;
     _inventoryManageService    = inventoryManageService;
     _productReservationService = productReservationService;
     _auctionService            = auctionService;
     _discountService           = discountService;
     _paymentService            = paymentService;
     _paymentTransactionService = paymentTransactionService;
 }
 public PaymentPayPalStandardController(IWorkContext workContext,
                                        IStoreService storeService,
                                        ISettingService settingService,
                                        IPaymentService paymentService,
                                        IOrderService orderService,
                                        ITranslationService translationService,
                                        ILogger logger,
                                        IMediator mediator,
                                        IPermissionService permissionService,
                                        IPaymentTransactionService paymentTransactionService,
                                        PaymentSettings paymentSettings)
 {
     _workContext               = workContext;
     _storeService              = storeService;
     _settingService            = settingService;
     _paymentService            = paymentService;
     _orderService              = orderService;
     _translationService        = translationService;
     _logger                    = logger;
     _mediator                  = mediator;
     _permissionService         = permissionService;
     _paymentTransactionService = paymentTransactionService;
     _paymentSettings           = paymentSettings;
 }
示例#30
0
 public PaymentOperation(RequestPayment request, PaymentTransactionService service)
 {
     this.request.Header            = new Header();
     this.request                   = request;
     this.paymentTransactionService = service;
 }
示例#31
0
 public CallbackController(ILogger <CallbackController> logger, IPaymentTransactionService paymentsService, PaymentGatewayConfig config)
 {
     this.logger         = logger;
     this.paymentService = paymentsService;
     this.config         = config;
 }
示例#32
0
 public DefaultPaymentProcessor(IPaymentTransactionService paymentTransactionService, IStoreCreditService storeCreditService)
 {
     _paymentTransactionService = paymentTransactionService;
     _storeCreditService        = storeCreditService;
 }