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

androidpublisher: PaymentState should be a pointer type #727

Closed
henriqueoelze opened this issue Oct 27, 2020 · 3 comments · Fixed by #1663
Closed

androidpublisher: PaymentState should be a pointer type #727

henriqueoelze opened this issue Oct 27, 2020 · 3 comments · Fixed by #1663
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@henriqueoelze
Copy link

Working with the api, I notice that PendingState is not using a pointer, but the value 0 is a valid information to business:

PaymentState int64 `json:"paymentState,omitempty"`

I believe will be best to change it to a pointer like the PurchaseType (example).

I notice that because when I call the .MarshalJSON() the field disappeared.

If allowed, I can submit this PR.

@codyoss
Copy link
Member

codyoss commented Oct 27, 2020

It looks like the case when this is not sent is when a subscription has lapsed or expired. I think it should be possible to check the UserCancellationTimeMillis and ExpiryTimeMillis currently to see if you need to look at payment state, right?

But I agree, this field could be made a pointer type to remove any ambiguity. These files are auto-generated, so it is the generator that needs to be updated to make such a change. If you want to make the change we happily accept pull requests. But I can make the change too, let me know what you think.

@codyoss codyoss added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Oct 27, 2020
@codyoss codyoss changed the title PaymentState should be a pointer because pending cannot be identified correctly. androidpublisher: PaymentState should be a pointer type Oct 27, 2020
@henriqueoelze
Copy link
Author

Thanks @codyoss . Fell free to implement, it is not a problem at all for me 😄 .
My suggestion of a pull request is more related to timing, so if it will take a lot of time because of priorities, I can help with that, otherwise, go ahead.

@leearmstrong
Copy link

Hey all, I see this didn't make it but am seeing the same thing and would like it to be a *int64 ideally.

eisandbar added a commit to eisandbar/google-api-go-client that referenced this issue Aug 16, 2022
Added field PaymentState of schema SubscriptionPurchase of the androidpublisher:v3 api to the list of pointerFields. This was done the same way as it was previously done for v2. Fixes googleapis#727
eisandbar added a commit to eisandbar/google-api-go-client that referenced this issue Aug 16, 2022
Added field PaymentState of schema SubscriptionPurchase of the androidpublisher:v3 api to the list of pointerFields.
This was done the same way as it was previously done for v2.

Fixes googleapis#727
gcf-merge-on-green bot pushed a commit that referenced this issue Aug 16, 2022
…1663)

Added field PaymentState of schema SubscriptionPurchase of the androidpublisher:v3 api to the list of pointerFields. This was done the same way as it was previously done for v2.

Fixes #727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants