Exemplo n.º 1
0
        public Phone(ISettingsProvider settingsProvider)
        {
            if (settingsProvider == null)
            {
                throw new ArgumentNullException(nameof(settingsProvider));
            }

            _paymentProviderSettings = settingsProvider.GetSettings <PaymentProviderSettings>(nameof(Phone));
        }
Exemplo n.º 2
0
        public ClickAndCollect(ISettingsProvider settingsProvider)
        {
            if (settingsProvider == null)
            {
                throw new ArgumentNullException(nameof(settingsProvider));
            }

            _paymentProviderSettings = settingsProvider.GetSettings <PaymentProviderSettings>(nameof(ClickAndCollect));
        }
Exemplo n.º 3
0
        public CashOnDelivery(ISettingsProvider settingsProvider)
        {
            if (settingsProvider == null)
            {
                throw new ArgumentNullException(nameof(settingsProvider));
            }

            _paymentProviderSettings = settingsProvider.GetSettings <PaymentProviderSettings>(nameof(CashOnDelivery));
        }
Exemplo n.º 4
0
        public DirectTransfer(ISettingsProvider settingsProvider)
        {
            if (settingsProvider == null)
            {
                throw new ArgumentNullException(nameof(settingsProvider));
            }

            _paymentProviderSettings = settingsProvider.GetSettings <PaymentProviderSettings>(nameof(DirectTransfer));
        }
Exemplo n.º 5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            PaymentProviderSettings foo = new PaymentProviderSettings();

            this.Configuration.BindOrThrow("PaymentProvider", foo);

            services.Configure <DocumentDbSettings>(settings => { this.Configuration.BindOrThrow("DocumentDB", settings); });
            services.Configure <PaymentProviderSettings>(settings => { this.Configuration.BindOrThrow("PaymentProvider", settings); });

            services.AddMediatR();

            services.AddTransient <IPaymentProviderService, PaymentProviderService>()
            .AddSingleton <IPaymentsRepository, PaymentsRepository>()
            .AddSingleton <IDocumentClientFactory, DocumentClientFactory>();
        }
 public GetPaymentProviderRedirectQuery(IOptions <PaymentProviderSettings> paymentProviderSettings)
 {
     this.paymentProviderSettings = paymentProviderSettings.Value;
 }
 public PaymentProviderService(IMediator mediator, IOptions <PaymentProviderSettings> paymentProviderSettings)
 {
     this.mediator = mediator;
     this.paymentProviderSettings = paymentProviderSettings.Value;
 }