Ejemplo n.º 1
0
 public IActionResult ClientConfig(int options = 5, decimal amount = 500, string currency = "USD")
 {
     return(View(new CommonTestModel()
     {
         PublicToken = FlexFields.Authenticate(this.FlexFieldsEnv, SplititApiUsername, SplititApiPassword)
                       .AddInstallments(Enumerable.Range(1, options).ToList())
                       .GetPublicToken(amount, currency)
     }));
 }
Ejemplo n.º 2
0
 public IActionResult PreselectedNumInstallments(int options = 12, decimal amount = 500, int preselectedOption = 10, string currency = "USD")
 {
     return(View(new CommonTestModel()
     {
         PublicToken = FlexFields.Authenticate(this.FlexFieldsEnv, SplititApiUsername, SplititApiPassword)
                       .AddInstallments(Enumerable.Range(1, options).ToList(), defaultNumInstallments: preselectedOption)
                       .GetPublicToken(amount, currency)
     }));
 }
Ejemplo n.º 3
0
 public IActionResult DeferredCapture(int options = 5, decimal amount = 500, decimal firstInstallment = 100, int delayDays = 10, string currency = "USD")
 {
     return(View(new CommonTestModel()
     {
         PublicToken = FlexFields.Authenticate(this.FlexFieldsEnv, SplititApiUsername, SplititApiPassword)
                       .AddInstallments(Enumerable.Range(1, options).ToList())
                       .AddCaptureSettings(firstInstallmentAmount: firstInstallment, currencyCode: currency, firstChargeDate: DateTime.Now.AddDays(delayDays))
                       .GetPublicToken(amount, currency)
     }));
 }
Ejemplo n.º 4
0
        public IActionResult Debug(int options = 5, int amount = 1000)
        {
            var model = new DebugViewModel();

            model.InstallmentOptions = $"[{string.Join(",", Enumerable.Range(1, options))}]";

            model.PublicToken = FlexFields
                                .Authenticate(this.FlexFieldsEnv, SplititApiUsername, SplititApiPassword)
                                .AddInstallments(Enumerable.Range(1, options).ToList())
                                .GetPublicToken(amount, "USD");

            return(View(model));
        }
Ejemplo n.º 5
0
 public IActionResult DesignChooser(int options = 5, decimal amount = 500, string currency = "USD", string culture = "en-US", string design = "splitit-default-ui grouped", string picker = null)
 {
     return(View(new CommonTestModel()
     {
         PublicToken = FlexFields.Authenticate(this.FlexFieldsEnv, SplititApiUsername, SplititApiPassword)
                       .AddInstallments(Enumerable.Range(1, options).ToList())
                       .GetPublicToken(amount, currency),
         Currency = currency,
         Culture = culture,
         Design = design,
         Picker = picker
     }));
 }