public void CheckoutOptions_Serialize_PropertyNamesAsExpected()
        {
            // Arrange
            var checkoutOptions = new CheckoutOptions();

            // Act
            var serializedObject = JsonConvert.SerializeObject(checkoutOptions);

            // Assert
            Assert.AreEqual(@"{
				""tax_tables"": null,
				""shipping_methods"": null,
				""rounding_policy"": null,
                ""no_shipping_method"": false
			}".RemoveWhiteSpace(), serializedObject.RemoveWhiteSpace());
        }
Exemple #2
0
 public static OrderRequest CreateDirectEinvoiceOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions, Customer customer, DeliveryAddress deliveryAddress)
 {
     return(new OrderRequest(
                OrderType.Direct,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         GatewayId = "EINVOICE",
         GatewayInfo = gatewayInfo,
         ShoppingCart = shoppingCart,
         Customer = customer,
         DeliveryAddress = deliveryAddress,
         CheckoutOptions = checkoutOptions
     });
 }
Exemple #3
0
 public static OrderRequest CreateFastCheckoutOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions)
 {
     return(new OrderRequest(
                OrderType.FastCheckout,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         ShoppingCart = shoppingCart,
         CheckoutOptions = checkoutOptions
     });
 }
Exemple #4
0
 public static OrderRequest CreateRedirectPayAfterDeliveryOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions, Customer customer)
 {
     return(new OrderRequest(
                OrderType.Redirect,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         GatewayId = "PAYAFTER",
         GatewayInfo = gatewayInfo,
         ShoppingCart = shoppingCart,
         Customer = customer,
         CheckoutOptions = checkoutOptions
     });
 }
Exemple #5
0
 public static OrderRequest CreateDirectPayAfterDeliveryOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions, Customer customer)
 {
     return new OrderRequest(
         OrderType.Direct,
         orderId,
         description,
         amountInCents,
         currencyCode,
         paymentOptions)
     {
         GatewayId = "PAYAFTER",
         GatewayInfo = gatewayInfo,
         ShoppingCart = shoppingCart,
         Customer = customer,
         CheckoutOptions = checkoutOptions
     };
 }
Exemple #6
0
 public static OrderRequest CreateDirectKlarnaOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions, Customer customer, DeliveryAddress deliveryAddress)
 {
     return new OrderRequest(
         OrderType.Direct,
         orderId,
         description,
         amountInCents,
         currencyCode,
         paymentOptions)
     {
         GatewayId = "KLARNA",
         GatewayInfo = gatewayInfo,
         ShoppingCart = shoppingCart,
         Customer = customer,
         DeliveryAddress = deliveryAddress,
         CheckoutOptions = checkoutOptions
     };
 }
Exemple #7
0
 public static OrderRequest CreateFastCheckoutOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, ShoppingCart shoppingCart, CheckoutOptions checkoutOptions)
 {
     return new OrderRequest(
         OrderType.FastCheckout,
         orderId,
         description,
         amountInCents,
         currencyCode,
         paymentOptions)
     {
         ShoppingCart = shoppingCart,
         CheckoutOptions = checkoutOptions
     };
 }