/// <summary>
        /// Initializes a new instance of the <see cref="MollieClientBase" /> class.
        /// </summary>
        /// <param name="clientService">The client service.</param>
        /// <param name="options">The options.</param>
        /// <param name="logger">The logger.</param>
        protected MollieClientBase(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <MollieClientBase> logger)
            : base(logger)
        {
            Argument.IsNotNull(options);

            _clientService    = clientService;
            _mollieApiOptions = options.Value;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseApiTestFixture"/> class.
        /// </summary>
        /// <autogeneratedoc />
        public BaseApiTestFixture()
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);

            Configuration = builder.Build();

            var services = new ServiceCollection();

            services.Configure <MollieApiOptions>(Configuration.GetSection(nameof(MollieApiOptions)));

            var appSettings = new MollieApiOptions();

            Configuration.GetSection(nameof(MollieApiOptions)).Bind(appSettings);

            services.AddPaymentGatewayMollie();

            // Register all available forms
            services.AddTransient <PaymentClient>();
            services.AddTransient <PaymentMethodClient>();
            services.AddTransient <RefundClient>();
            services.AddTransient <SubscriptionClient>();
            services.AddTransient <MandateClient>();
            services.AddTransient <CustomerClient>();
            services.AddTransient <CustomerClient>();
            services.AddTransient <ProfileClient>();
            services.AddTransient <OrderClient>();

            ServiceProvider = services.BuildServiceProvider();

            ClientService       = ServiceProvider.GetRequiredService <IMollieClientService>();
            PaymentClient       = ServiceProvider.GetRequiredService <PaymentClient>();
            PaymentMethodClient = ServiceProvider.GetRequiredService <PaymentMethodClient>();
            RefundClient        = ServiceProvider.GetRequiredService <RefundClient>();
            SubscriptionClient  = ServiceProvider.GetRequiredService <SubscriptionClient>();
            MandateClient       = ServiceProvider.GetRequiredService <MandateClient>();
            CustomerClient      = ServiceProvider.GetRequiredService <CustomerClient>();
            CustomerClient      = ServiceProvider.GetRequiredService <CustomerClient>();
            ProfileClient       = ServiceProvider.GetRequiredService <ProfileClient>();
            OrderClient         = ServiceProvider.GetRequiredService <OrderClient>();

            EnsureTestApiKey(appSettings);
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SubscriptionClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public SubscriptionClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <SubscriptionClient> logger) : base(clientService, options, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PermissionsClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public PermissionsClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <PermissionsClient> logger) : base(clientService, options, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SettlementsClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public SettlementsClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <SettlementsClient> logger) : base(clientService, options, logger)
 {
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChargebacksClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public ChargebacksClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <ChargebacksClient> logger) : base(clientService, options, logger)
 {
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InvoicesClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public InvoicesClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <InvoicesClient> logger) : base(clientService, options, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PaymentMethodClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public PaymentMethodClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <PaymentMethodClient> logger) : base(clientService, options, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public CustomerClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <CustomerClient> logger) : base(clientService, options, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OrganizationsClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public OrganizationsClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <OrganizationsClient> logger) : base(clientService, options, logger)
 {
 }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RefundClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public RefundClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <RefundClient> logger) : base(clientService, options, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MandateClient" /> class.
 /// </summary>
 /// <param name="clientService">The client service.</param>
 /// <param name="options">The options.</param>
 /// <param name="logger">The logger.</param>
 public MandateClient(IMollieClientService clientService, IOptions <MollieApiOptions> options, ILogger <MandateClient> logger) : base(clientService, options, logger)
 {
 }