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

What happened to StripeChargeCreateOptions and StripeChargeService? #1349

Closed
UweKeim opened this issue Oct 23, 2018 · 10 comments
Closed

What happened to StripeChargeCreateOptions and StripeChargeService? #1349

UweKeim opened this issue Oct 23, 2018 · 10 comments

Comments

@UweKeim
Copy link

UweKeim commented Oct 23, 2018

Just updated the NuGet package to v20.1.0 just to see compiler errors about undefined symbols for StripeChargeService and StripeChargeCreateOptions.

Are there migration paths available to whatever's hot now?

@remi-stripe
Copy link
Contributor

remi-stripe commented Oct 23, 2018

Hey @UweKeim! Sorry about the confusion here! The 20.0 release was a major release which introduced numerous breaking changes. The main one was removing the Stripe prefix from most of the classes in stripe-dotnet. We wrote a detailed migration guide that you can find here: https://github.com/stripe/stripe-dotnet/wiki/Migration-guide-for-v20

Let me know if this doesn't help!

@ob-stripe
Copy link
Contributor

Hi @UweKeim. Something to keep in mind when upgrading stripe-dotnet: we use semantic versioning, meaning that we increment the major version number whenever breaking changes are introduced. This means that it's always safe to upgrade to a new a minor or patch version, but you should always check the changelog before upgrading to a new major version.

@ob-stripe
Copy link
Contributor

To answer your specific question, we've removed the Stripe prefix from most classes (it was redundant since everything is already in the Stripe namespace). So StripeChargeService is now ChargeService, StripeChargeCreateOptions is now ChargeCreateOptions, etc.

Closing the issue, but feel free to reply if you're having trouble or have any suggestions to improve the migration guide!

@UweKeim
Copy link
Author

UweKeim commented Oct 23, 2018

Thanks a lot guys!

@StachuDotNet
Copy link

Above migration guide's link is broken.
Working one: https://github.com/stripe/stripe-dotnet/wiki/Migration-guide-for-v20

@remi-stripe, fyi, may be worth updating your comment here.

@Alexislml96
Copy link

I think this is old, but i have a question about the "StripeChargeService" i used
var service = new StripeChargeService("sk_test_xxxxxxxxxxxxx");
so, how can i use it with ChargeService. Thanks.

@remi-stripe
Copy link
Contributor

@Alexislml96 The change was mostly a rename from StripeChargeService to ChargeService without the Stripe prefix. You can read more about this in the wiki mentioned before: https://github.com/stripe/stripe-dotnet/wiki/Migration-guide-for-v20

@Alexislml96
Copy link

Yes i understand that, my question is where can i put the "sk_test" key in the ChargeService method?

@remi-stripe
Copy link
Contributor

You would do something like this:

var service = new ChargeService(new StripeClient("sk_test_123"));

@Alexislml96
Copy link

Wll finally i can resolve it, i just need to put the key like this at the beginning of the code in the server side.
StripeConfiguration.ApiKey = "sk_test_";
Thanks.

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

5 participants