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

Use parser plugins during SubscriptionItemUpdatedPlugin item creation #1143

Merged
merged 1 commit into from
Mar 21, 2018

Conversation

TobiasMelen
Copy link
Contributor

@TobiasMelen TobiasMelen commented Mar 20, 2018

This PR makes the SubscriptionItemPlugin use the parser plugins in RequestStringBuilder when creating request values for items in subscription update. This solves an issue with the input metadata parsing. The Metadata dictionary property needs to be parsed by DictionaryParserPlugin to create a valid Stripe request.
An inline JsonPropertyAttribute is created, which isn't pretty. Any other change would require a larger refactor.
I had to run the project locally with XUnit 2.3.0 due to Visual Studio issues, so the testcode should probably be validated on XUnit 2.2.0.

Fixes #1142.

@ob-stripe
Copy link
Contributor

Hey @TobiasMelen, thanks for the contribution!

An inline JsonPropertyAttribute is created, which isn't pretty. Any other change would require a larger refactor.

Yeah, it's slightly hacky, but the state of parameter encoding in stripe-dotnet isn't great (there's a lot of special casing) and subscription items encoding in particular has required special casing anyway in our other language libraries. Your fix is fine with me, pending a larger rewrite of the parameter encoding logic.

Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ob-stripe ob-stripe merged commit 27186b0 into stripe:master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants