Ejemplo n.º 1
0
        public void TestDeliverPaymentPlanOrderResult()
        {
            GetPaymentPlanParamsEuResponse paymentPlanParamResponse = WebpayConnection.GetPaymentPlanParams(SveaConfig.GetDefaultConfig())
                                                                      .SetCountryCode(TestingTool.DefaultTestCountryCode)
                                                                      .DoRequest();
            long code = paymentPlanParamResponse.CampaignCodes[0].CampaignCode;

            CreateOrderEuResponse createOrderResponse = WebpayConnection.CreateOrder(SveaConfig.GetDefaultConfig())
                                                        .AddOrderRow(TestingTool.CreatePaymentPlanOrderRow())
                                                        .AddCustomerDetails(
                TestingTool.CreateIndividualCustomer())
                                                        .SetCountryCode(TestingTool.DefaultTestCountryCode)
                                                        .SetCustomerReference(
                TestingTool.DefaultTestClientOrderNumber)
                                                        .SetClientOrderNumber(TestingTool.DefaultTestClientOrderNumber)
                                                        .SetOrderDate(TestingTool.DefaultTestDate)
                                                        .SetCurrency(TestingTool.DefaultTestCurrency)
                                                        .UsePaymentPlanPayment(code)
                                                        .DoRequest();

            DeliverOrderEuResponse deliverOrderResponse = WebpayConnection.DeliverOrder(SveaConfig.GetDefaultConfig())
                                                          .AddOrderRow(TestingTool.CreateExVatBasedOrderRow())
                                                          .SetOrderId(
                createOrderResponse.CreateOrderResult
                .SveaOrderId)
                                                          .SetNumberOfCreditDays(1)
                                                          .SetInvoiceDistributionType(
                InvoiceDistributionType.POST)
                                                          .SetCountryCode(TestingTool.DefaultTestCountryCode)
                                                          .DeliverPaymentPlanOrder()
                                                          .DoRequest();

            Assert.That(deliverOrderResponse.Accepted, Is.True);
        }
Ejemplo n.º 2
0
        public void TestDeliverPaymentPlanOrderDoRequest()
        {
            DeliverOrderEuResponse response =
                WebpayConnection.DeliverOrder(SveaConfig.GetDefaultConfig())
                .AddOrderRow(TestingTool.CreateExVatBasedOrderRow())
                .SetOrderId(54086L)
                .SetInvoiceDistributionType(InvoiceDistributionType.POST)
                .SetCountryCode(TestingTool.DefaultTestCountryCode)
                .DeliverInvoiceOrder()
                .DoRequest();

            Assert.That(response.ErrorMessage, Is.EqualTo("An order with the provided id does not exist."));
        }
Ejemplo n.º 3
0
        public void TestDeliverPaymentPlanOrderDoRequest()
        {
            DeliverOrderEuResponse response =
                WebpayConnection.DeliverOrder(SveaConfig.GetDefaultConfig())
                .AddOrderRow(TestingTool.CreateExVatBasedOrderRow())
                .SetOrderId(54086L)
                .SetInvoiceDistributionType(DistributionType.POST)
                .SetCountryCode(TestingTool.DefaultTestCountryCode)
                .DeliverPaymentPlanOrder()
                .DoRequest();

            Assert.That(response.ErrorMessage, Is.EqualTo("Could not complete the request to deliver an order!"));
        }
Ejemplo n.º 4
0
        public void TestDeliverPaymentPlanOrderResult()
        {
            long orderId = createPaymentPlanAndReturnOrderId();

            DeliverOrderEuResponse response = WebpayConnection.DeliverOrder(SveaConfig.GetDefaultConfig())
                                              .AddOrderRow(TestingTool.CreatePaymentPlanOrderRow())
                                              .SetOrderId(orderId)
                                              .SetNumberOfCreditDays(1)
                                              .SetInvoiceDistributionType(InvoiceDistributionType.POST)
                                              .SetCountryCode(TestingTool.DefaultTestCountryCode)
                                              .DeliverPaymentPlanOrder()
                                              .DoRequest();

            Assert.That(response.Accepted, Is.True);
        }
Ejemplo n.º 5
0
        public void TestDeliverInvoiceOrderWithEInvoiceB2BResult()
        {
            long orderId = CreateNorwegianExVatInvoiceAndReturnOrderId();

            DeliverOrderEuResponse response = WebpayConnection.DeliverOrder(SveaConfig.GetDefaultConfig())
                                              .AddOrderRow(TestingTool.CreateExVatBasedOrderRow("1"))
                                              .SetOrderId(orderId)
                                              .SetNumberOfCreditDays(1)
                                              .SetInvoiceDistributionType(DistributionType.EINVOICEB2B)
                                              .SetCountryCode(CountryCode.NO)
                                              .DeliverInvoiceOrder()
                                              .DoRequest();

            Assert.That(response.Accepted, Is.True);
            Assert.That(response.DeliverOrderResult.InvoiceResultDetails.InvoiceDistributionType, Is.EqualTo(WebpayWS.InvoiceDistributionType.EInvoiceB2B));
        }
Ejemplo n.º 6
0
        public void TestDeliverInvoiceOrderResult()
        {
            long orderId = CreateInvoiceAndReturnOrderId();

            DeliverOrderEuResponse response = WebpayConnection.DeliverOrder(SveaConfig.GetDefaultConfig())
                                              .AddOrderRow(TestingTool.CreateExVatBasedOrderRow("1"))
                                              .SetOrderId(orderId)
                                              .SetNumberOfCreditDays(1)
                                              .SetInvoiceDistributionType(InvoiceDistributionType.POST)
                                              .SetCountryCode(TestingTool.DefaultTestCountryCode)
                                              .DeliverInvoiceOrder()
                                              .DoRequest();

            Assert.That(response.Accepted, Is.True);
            Assert.That(response.DeliverOrderResult.InvoiceResultDetails.InvoiceDistributionType, Is.EqualTo(WebpayWS.InvoiceDistributionType.Post));
            Assert.That(response.DeliverOrderResult.InvoiceResultDetails.Ocr, Is.Not.Null);
            Assert.That(response.DeliverOrderResult.InvoiceResultDetails.Ocr.Length, Is.GreaterThan(0));
            Assert.That(response.DeliverOrderResult.InvoiceResultDetails.LowestAmountToPay, Is.EqualTo(0.0));
        }