TypeInitializationException Stripe.StripeConfiguration payment

153 Views Asked by At

I'm trying to use Stripe on my web following this Stripe doc: https://stripe.com/docs/legacy-checkout/webforms but when i debug the code throws a TypeInitializationException on both create(), the customer and charge.

if (Request.Form["stripeToken"] != null)
    {
        var optionsCustomer = new CustomerCreateOptions
        {
            Email = Request.Form["stripeEmail"].ToString(),
            Source = Request.Form["stripeToken"].ToString(),
        };

        var serviceCustomer = new CustomerService();
        Customer customer = serviceCustomer.Create(optionsCustomer);


        var optionsCharge = new ChargeCreateOptions
        {
            Amount = 1099,
            Currency = "eur",
        };

        var serviceCharge = new ChargeService();
        serviceCharge.Create(optionsCharge);
    }
0

There are 0 best solutions below