示例#1
0
        public void PaymentOptions_CloseWindow_DefaultsToTrue()
        {
            // Act
            var paymentOptions = new PaymentOptions();

            // Assert
            Assert.IsTrue(paymentOptions.CloseWindow);
        }
示例#2
0
 private OrderRequest(OrderType type, string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     Type           = type;
     OrderId        = orderId;
     Description    = description;
     AmountInCents  = amountInCents;
     CurrencyCode   = currencyCode;
     PaymentOptions = paymentOptions;
 }
示例#3
0
 public static OrderRequest CreateRedirect(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return new OrderRequest(
         OrderType.Redirect,
         orderId,
         description,
         amountInCents,
         currencyCode,
         paymentOptions);
 }
示例#4
0
 private OrderRequest(OrderType type, string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     Type = type;
     OrderId = orderId;
     Description = description;
     AmountInCents = amountInCents;
     CurrencyCode = currencyCode;
     PaymentOptions = paymentOptions;
     CustomInfo = new ExpandoObject();
 }
示例#5
0
 public static OrderRequest CreateDirectIdeal(string issuerId, string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return new OrderRequest(
         OrderType.Direct,
         orderId,
         description,
         amountInCents,
         currencyCode,
         paymentOptions)
     {
         GatewayId = "iDEAL",
         GatewayInfo = GatewayInfo.IDeal(issuerId)
     };
 }
示例#6
0
        public void PaymentOptions_Serialize_PropertyNamesAsExpected()
        {
            // Arrange
            var paymentOptions = new PaymentOptions();

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

            // Assert
            Assert.AreEqual(@"{
		                    ""notification_url"": null,
		                    ""redirect_url"":null,
		                    ""cancel_url"":null,
		                    ""close_window"":true
	        }".RemoveWhiteSpace(), serializedObject.RemoveWhiteSpace());
        }
示例#7
0
 public static OrderRequest CreateDirectIdeal(string issuerId, string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return(new OrderRequest(
                OrderType.Direct,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         GatewayId = "iDEAL",
         GatewayInfo = GatewayInfo.IDeal(issuerId)
     });
 }
示例#8
0
 public static OrderRequest CreateDirectIdealQR(GatewayInfo GatewayInfo, string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return(new OrderRequest(
                OrderType.Redirect,//Also supported empty or OrderType.Direct
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         GatewayId = "IDEALQR",
         GatewayInfo = GatewayInfo.IDealQR(
             GatewayInfo.QrSize,
             GatewayInfo.MaxAmount,
             GatewayInfo.AllowMultiple,
             GatewayInfo.AllowChangeAmount)
     });
 }
示例#9
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
     });
 }
示例#10
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
     });
 }
示例#11
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
     });
 }
示例#12
0
 public static OrderRequest CreateDirectBankTransfer(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return(new OrderRequest(
                OrderType.Direct,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         GatewayId = "BANKTRANS"
     });
 }
示例#13
0
 public static OrderRequest CreateRedirectPayAfterDeliveryOrder(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, GatewayInfo gatewayInfo, ShoppingCart shoppingCart, Customer customer)
 {
     return(CreateRedirectPayAfterDeliveryOrder(orderId, description, amountInCents, currencyCode, paymentOptions, gatewayInfo, shoppingCart, new CheckoutOptions(), customer));
 }
示例#14
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
     };
 }
示例#15
0
 public static OrderRequest CreateRedirect(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return(new OrderRequest(
                OrderType.Redirect,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions));
 }
示例#16
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
     };
 }
示例#17
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
     };
 }
示例#18
0
 public static OrderRequest CreateRedirectWithTemplate(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions, string TemplateId, Template Template)
 {
     return(new OrderRequest(
                OrderType.Redirect,
                orderId,
                description,
                amountInCents,
                currencyCode,
                paymentOptions)
     {
         TemplateId = TemplateId,
         Template = Template
     });
 }
示例#19
0
 public static OrderRequest CreateDirectBankTransfer(string orderId, string description, int amountInCents, string currencyCode, PaymentOptions paymentOptions)
 {
     return new OrderRequest(
         OrderType.Direct,
         orderId,
         description,
         amountInCents,
         currencyCode,
         paymentOptions)
     {
         GatewayId = "BANKTRANS"
     };
 }