示例#1
0
        public async Task CanRequestIdealPayment()
        {
            var alternativePaymentSource = new AlternativePaymentSource("ideal")
            {
                { "issuer_id", "INGBNL2A" }
            };

            await RequestAlternativePaymentAsync(alternativePaymentSource);
        }
示例#2
0
        public async Task CanRequestGiropayPayment()
        {
            var alternativePaymentSource = new AlternativePaymentSource("giropay")
            {
                { "bic", "TESTDETT421" },
                { "purpose", "CKO giropay test" }
            };

            await RequestAlternativePaymentAsync(alternativePaymentSource);
        }
示例#3
0
        public async Task CanRequestIdealPayment()
        {
            var alternativePaymentSource = new AlternativePaymentSource("ideal")
            {
                { "bic", "INGBNL2A" },
                { "description", "NET SDK Test" }
            };

            await RequestAlternativePaymentAsync(alternativePaymentSource);
        }
示例#4
0
        private async Task <PaymentPending> RequestAlternativePaymentAsync(AlternativePaymentSource alternativePaymentSource)
        {
            PaymentRequest <IRequestSource> paymentRequest = TestHelper.CreateAlternativePaymentMethodRequest(alternativePaymentSource, currency: Currency.EUR);

            PaymentResponse apiResponse = await _api.Payments.RequestAsync(paymentRequest);

            apiResponse.IsPending.ShouldBeTrue();
            apiResponse.Pending.ShouldNotBeNull();

            PaymentPending pendingPayment = apiResponse.Pending;

            pendingPayment.Id.ShouldNotBeNullOrEmpty();
            pendingPayment.Status.ShouldBe(PaymentStatus.Pending);
            pendingPayment.Reference.ShouldBe(paymentRequest.Reference);
            pendingPayment.Customer.ShouldNotBeNull();
            pendingPayment.Customer.Id.ShouldNotBeNullOrEmpty();
            pendingPayment.Customer.Email.ShouldNotBeNullOrEmpty();
            pendingPayment.RequiresRedirect().ShouldBeTrue();
            pendingPayment.GetRedirectLink().ShouldNotBeNull();

            return(pendingPayment);
        }
示例#5
0
        public async Task CanGetAlternativePayment()
        {
            var alternativePaymentSource = new AlternativePaymentSource("giropay")
            {
                { "bic", "TESTDETT421" },
                { "purpose", "CKO giropay test" }
            };

            PaymentPending payment = await RequestAlternativePaymentAsync(alternativePaymentSource);

            GetPaymentResponse verifiedPayment = await _api.Payments.GetAsync(payment.Id);

            verifiedPayment.ShouldNotBeNull();
            verifiedPayment.Id.ShouldBe(payment.Id);

            var verifiedSource = verifiedPayment.Source.AsAlternativePayment();

            foreach (string key in verifiedSource.Keys)
            {
                verifiedSource[key].ShouldBe(alternativePaymentSource[key]);
            }
        }