Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception - Unable to process payment via Stripe, Version=1.12.0.0 #75

Open
greatonkarft opened this issue Jul 16, 2018 · 1 comment
Open

Comments

@greatonkarft
Copy link

var _stripeClient = new Stripe.StripeClient(_apiKey);
var _response = _stripeClient.CreateChargeWithToken(1000, _stripeToken, “USD”, _stripeEmail);

Getting exception below while executing above snippet

Value cannot be null.
Parameter name: dictionary

StackTrace:

at System.Collections.Generic.Dictionary2..ctor(IDictionary2 dictionary, IEqualityComparer1 comparer) at Stripe.JsonObject.SetModel(IDictionary2 model)
at Stripe.StripeClient.ExecuteObject(RestRequest request)
at Stripe.StripeClient.CreateChargeWithToken(Decimal amount, String token, String currency, String description, Nullable`1 application_fee)

Please check and confirm any issues from your side.

@Netrixdesigns
Copy link

Same issue and error, has anyone ever use this nugget and was successful. No thorough documentation

protected void btncharge_Click(object sender, EventArgs e)
{
var apiKey = "sk_test_51IKMAnLT9tteS1RKRSOLk82ApueaicJgQCTZLpigYtjboxdYia5F1QWX9GHHdrWsdyAEPKAT0JsL1E8NJODjrtGF00IgKWWAiS";

    var api = new StripeClient(apiKey);

    var card = new CreditCard
    {
        Number = "4242424242424242",
        ExpMonth = 3,
        ExpYear = 2022,
        Cvc = "123"

    };

   
    dynamic response = api.CreateCharge(
  amount: 100.00m, // $100
currency: "usd",
card: card);


    if (!response.IsError &&  response.Paid)
        lblresponse.Text  = "Whoo Hoo...  We made our first sale!";
    else
        lblresponse.Text = ("Payment failed. :(");

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants