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

Create plans and products using 2017-12-01 API version format #496

Conversation

jhoon-stripe
Copy link
Contributor

Summary

This PR implements upcoming changes to the way in which plan objects are created in the Stripe API. Specifically, it:

  • Allows plans to be created with products (with a product ID)
  • Allows plans to be created with inline product fields

Testing

Tested against stripe-mock using as-yet unreleased spec- and fixture updates.

r? @brandur-stripe @tmaxwell-stripe
cc @stripe/api-libraries

@jhoon-stripe
Copy link
Contributor Author

This is going to remain a work-in-progress until we've released a new API version and can push updates to stripe-mock.

@brandur-stripe
Copy link
Contributor

Thanks for pushing this along @jhoon-stripe!

Let us know how those server-side changes come along. Happy to review this in more detail when it's ready to come in.

Copy link
Contributor

@remi-stripe remi-stripe left a comment

Choose a reason for hiding this comment

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

minor comments

product.go Outdated
@@ -27,6 +27,8 @@ type ProductParams struct {
Name string `form:"name"`
PackageDimensions *PackageDimensions `form:"package_dimensions"`
Shippable *bool `form:"shippable"`
Statement string `form:"statement_descriptor"`
Copy link
Contributor

Choose a reason for hiding this comment

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

can you name it StatementDescriptor? I'm working on renaming all properties in #459 to ensure they match, as best as possible, the API name

product.go Outdated
@@ -27,6 +27,8 @@ type ProductParams struct {
Name string `form:"name"`
PackageDimensions *PackageDimensions `form:"package_dimensions"`
Shippable *bool `form:"shippable"`
Statement string `form:"statement_descriptor"`
Type string `form:"type"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Type should likely be using const instead of just a string. Example: on Account's Type here

product.go Outdated
@@ -47,8 +49,10 @@ type Product struct {
PackageDimensions *PackageDimensions `json:"package_dimensions"`
Shippable bool `json:"shippable"`
Skus *SKUList `json:"skus"`
Statement string `json:"statement_descriptor"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

product.go Outdated
URL string `json:"url"`
Updated int64 `json:"updated"`
Type string `json:"type"`
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@pantera-stripe
Copy link
Contributor

Should close this in favor of: #518

@ob-stripe
Copy link
Contributor

👍

@ob-stripe ob-stripe closed this Feb 15, 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.

8 participants