예제 #1
0
        public async Task CanRetrieveIssuersForAllMethods()
        {
            // When: retrieving the all mollie payment methods we can include the issuers
            ListResponse <PaymentMethodResponse> paymentMethods = await PaymentMethodClient.GetAllPaymentMethodListAsync(includeIssuers : true);

            // Then: We should have one or multiple issuers
            Assert.IsTrue(paymentMethods.Items.Any(x => x.Issuers != null));
        }
예제 #2
0
        public async Task CanRetrievePricingForAllMethods()
        {
            // When: retrieving the ideal method we can include the issuers
            ListResponse <PaymentMethodResponse> paymentMethods = await PaymentMethodClient.GetAllPaymentMethodListAsync(includePricing : true);

            // Then: We should have prices available
            Assert.IsTrue(paymentMethods.Items.Any(x => x.Pricing != null && x.Pricing.Any(y => y.Fixed.Value > 0)));
        }
        public async Task CanRetrieveIssuersForAllMethods()
        {
            // When: retrieving the all mollie payment methods we can include the issuers
            var paymentMethods = await PaymentMethodClient.GetAllPaymentMethodListAsync(includeIssuers : true);

            // Then: We should have one or multiple issuers
            Assert.Contains(paymentMethods.Items, x => x.Issuers != null);
        }
예제 #4
0
        public async Task CanRetrieveIssuersAndPricingInformation()
        {
            // When: retrieving the all mollie payment methods we can include the issuers
            ListResponse <PaymentMethodResponse> paymentMethods = await PaymentMethodClient.GetAllPaymentMethodListAsync(includeIssuers : true, includePricing : true);

            // Then: We should have one or multiple issuers
            Assert.IsTrue(paymentMethods.Items.Any(x => x.Issuers != null));
            Assert.IsTrue(paymentMethods.Items.Any(x => x.Pricing != null && x.Pricing.Any(y => y.Fixed.Value > 0)));
        }
예제 #5
0
        public async Task CanRetrieveAllMethods()
        {
            // When: retrieving the all mollie payment methods
            ListResponse <PaymentMethodResponse> paymentMethods = await PaymentMethodClient.GetAllPaymentMethodListAsync();

            // Then: We should have multiple issuers
            Assert.IsNotNull(paymentMethods);
            Assert.IsTrue(paymentMethods.Items.Any());
        }
예제 #6
0
        public async Task GetPaymentMethodListAsync_AmountParameterIsAdded_QueryStringContainsAmount()
        {
            // Given: We make a request to retrieve a order without wanting any extra data
            var                 mockHttp            = this.CreateMockHttpMessageHandler(HttpMethod.Get, $"{BaseMollieClient.ApiEndPoint}methods/all?amount[value]=100.00&amount[currency]=EUR", defaultPaymentMethodJsonResponse);
            HttpClient          httpClient          = mockHttp.ToHttpClient();
            PaymentMethodClient paymentMethodClient = new PaymentMethodClient("abcde", httpClient);

            // When: We send the request
            await paymentMethodClient.GetAllPaymentMethodListAsync(amount : new Amount("EUR", 100));

            // Then
            mockHttp.VerifyNoOutstandingExpectation();
        }
예제 #7
0
        public async Task GetPaymentMethodListAsync_NoAmountParameter_QueryStringIsEmpty()
        {
            // Given: We make a request to retrieve a order without wanting any extra data
            var                 mockHttp            = this.CreateMockHttpMessageHandler(HttpMethod.Get, $"{BaseMollieClient.ApiEndPoint}methods/all", defaultPaymentMethodJsonResponse);
            HttpClient          httpClient          = mockHttp.ToHttpClient();
            PaymentMethodClient paymentMethodClient = new PaymentMethodClient("abcde", httpClient);

            // When: We send the request
            await paymentMethodClient.GetAllPaymentMethodListAsync();

            // Then
            mockHttp.VerifyNoOutstandingExpectation();
        }