private async Task ShouldMakeSofortPayment() { var sofortSource = new RequestSofortSource(); var paymentRequest = new PaymentRequest { Source = sofortSource, Currency = Currency.EUR, Amount = 100, Capture = true, SuccessUrl = "https://testing.checkout.com/sucess", FailureUrl = "https://testing.checkout.com/failure" }; var paymentResponse = await DefaultApi.PaymentsClient().RequestPayment(paymentRequest); paymentResponse.ShouldNotBeNull(); paymentResponse.Status.ShouldBe(PaymentStatus.Pending); paymentResponse.ResponseSummary.ShouldBeNull(); paymentResponse.Links["self"].ShouldNotBeNull(); paymentResponse.Links["redirect"].ShouldNotBeNull(); var payment = await DefaultApi.PaymentsClient().GetPaymentDetails(paymentResponse.Id); payment.ShouldNotBeNull(); payment.Status.ShouldBe(PaymentStatus.Pending); payment.Links["self"].ShouldNotBeNull(); payment.Source.ShouldBeOfType(typeof(AlternativePaymentSourceResponse)); var source = (AlternativePaymentSourceResponse)payment.Source; source.Count.ShouldBePositive(); source.Type().ShouldBe(PaymentSourceType.Sofort); }
private async Task ShouldMakeSofortPayment() { var sofortSource = new RequestSofortSource { CountryCode = CountryCode.FR, LanguageCode = "fr" }; var paymentRequest = new PaymentRequest { Source = sofortSource, Currency = Currency.EUR, Amount = 100, Capture = true }; var paymentResponse = await PreviousApi.PaymentsClient().RequestPayment(paymentRequest); paymentResponse.ShouldNotBeNull(); paymentResponse.Status.ShouldBe(PaymentStatus.Pending); paymentResponse.ResponseSummary.ShouldBeNull(); paymentResponse.Links["self"].ShouldNotBeNull(); paymentResponse.Links["redirect"].ShouldNotBeNull(); var payment = await PreviousApi.PaymentsClient().GetPaymentDetails(paymentResponse.Id); payment.ShouldNotBeNull(); payment.Status.ShouldBe(PaymentStatus.Pending); payment.Links["self"].ShouldNotBeNull(); payment.Source.ShouldBeOfType(typeof(AlternativePaymentSourceResponse)); var source = (AlternativePaymentSourceResponse)payment.Source; source.Count.ShouldBePositive(); source.Type().ShouldBe(PaymentSourceType.Sofort); }