Beispiel #1
0
        public void CreateFormRequest(bool isNewTokenRequest, string token, string tokenNumber)
        {
            var customer    = CustomerFactory.Create();
            var paymentType = new PaymentType(isNewTokenRequest, token, tokenNumber);
            var urlProvider = new TestUrlProvider();
            var actual      = modelFactory.CreateFormRequest("testShoppingCartId", 15.50, customer, paymentType, urlProvider);

            var expected = new FormRequest
            {
                Url               = WSPayConfiguration.FormUrl.ToString(),
                ShopId            = RegularShop.ShopId,
                ShoppingCartID    = "testShoppingCartId",
                Amount            = "15,5",
                Signature         = "8bb5ec7f987f3cf3ce1e3153cfeab963",
                CustomerFirstName = customer.FirstName,
                CustomerSurname   = customer.LastName,
                CustomerEmail     = customer.Email,
                CustomerAddress   = customer.Address,
                CustomerPhone     = customer.Phone,
                IsTokenRequest    = paymentType.IsNewTokenRequest,
                Token             = paymentType.Token,
                TokenNumber       = paymentType.TokenNumber,
                FormattedDateTime = "20200401152030",
                ReturnUrl         = urlProvider.GetReturnUrl(),
                CancelUrl         = urlProvider.GetCancelUrl("testShoppingCartId"),
                ErrorUrl          = urlProvider.GetErrorUrl()
            };

            actual.Should().BeEquivalentTo(expected);
        }