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

fix: #578 by allowing arbitrary strings for PriceIds #580

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

thomasmost
Copy link
Contributor

@thomasmost thomasmost commented Jul 26, 2024

Summary

Fixes #578

Checklist

Cargo.toml Outdated
@@ -7,7 +7,7 @@ members = [

[package]
name = "async-stripe"
version = "0.37.2"
version = "0.37.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need to manually bump this. This will probably be taken care when a new version is created from master.

Copy link
Owner

Choose a reason for hiding this comment

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

Correct (and thanks for reviewing @augustoccesar!) please revert this line. You should instead prefix your commit message with fix: and semantic versioning will handle the rest.

src/ids.rs Outdated
@@ -555,7 +555,7 @@ def_id!(
def_id!(PersonId, "person_");
def_id!(PlanId: String); // N.B. A plan id can be user-provided so can be any arbitrary string
def_id!(PlatformTaxFeeId, "ptf");
def_id!(PriceId, "price_" | "plan_"); // see #470
def_id!(PriceId, "price_" | ""); // see #470
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this will basically behave like the PlanId and ProductId, that being: "it can be any arbitrary string", I would say that maybe it should be the same as them?

So something like:

Suggested change
def_id!(PriceId, "price_" | ""); // see #470
def_id!(PriceId, String);

Also not sure if the link to the issue #470 here will make sense anymore. But could be nice to add a comment explaining about why the PriceId can be any String? Or a link to your original issue. Wdyt?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, please change this to a string and add a comment. Thanks!

Copy link
Owner

@arlyon arlyon left a comment

Choose a reason for hiding this comment

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

Happy to merge this ASAP once the changes are addressed.

src/ids.rs Outdated
@@ -555,7 +555,7 @@ def_id!(
def_id!(PersonId, "person_");
def_id!(PlanId: String); // N.B. A plan id can be user-provided so can be any arbitrary string
def_id!(PlatformTaxFeeId, "ptf");
def_id!(PriceId, "price_" | "plan_"); // see #470
def_id!(PriceId, "price_" | ""); // see #470
Copy link
Owner

Choose a reason for hiding this comment

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

Yes, please change this to a string and add a comment. Thanks!

@thomasmost thomasmost changed the title Fixes #578 by allowing arbitrary strings for PriceIds fix: #578 by allowing arbitrary strings for PriceIds Jul 29, 2024
@arlyon
Copy link
Owner

arlyon commented Jul 29, 2024

Running CI, TY for being so responsive.

@augustoccesar
Copy link
Contributor

@thomasmost fyi, the Clippy CI issues should be fixed if you rebase the branch 🙏

@thomasmost
Copy link
Contributor Author

@augustoccesar whoops — will that merge do the trick?

@augustoccesar
Copy link
Contributor

@thomasmost that should do it!

@arlyon
Copy link
Owner

arlyon commented Jul 31, 2024

Running CI now will merge when done. TY!

@arlyon arlyon merged commit 63c6419 into arlyon:master Aug 6, 2024
16 of 17 checks passed
@arlyon
Copy link
Owner

arlyon commented Aug 6, 2024

All merged, Thank you for taking the time.

@arlyon
Copy link
Owner

arlyon commented Aug 6, 2024

🎉 This PR is included in version 0.38.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@arlyon arlyon added the released label Aug 6, 2024
@thomasmost
Copy link
Contributor Author

@arlyon Thanks for maintaining this crate!

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.

Webhook Parse failing with "invalid PriceId, expected id to start with "price_" or "plan_"
3 participants