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

Multiple fixes around NumericString type #256

Merged
merged 3 commits into from
Dec 11, 2023

Conversation

jbgosselin
Copy link
Contributor

Hi AWA team !

Here at TextNow we use your repository in order to communicate with Apple and Google for our IAP.

While using this repository, we found some potentialk improvements regarding the use of NumericString type.

We are using these fixes for a while in our Production environment and have no problem so far.

Changes:

  • Rename numericString to NumericString : This is usually a good pattern that every field of a public struct are made of purely public types. With this, we can easily build structs containing NumericString type in order to run tests and compare results.
  • Modify InApp.OriginalTransactionID from string to NumericString : similarly to ReceiptForIOS6.OriginalTransactionID, this field is also worth using NumericString. This also simplifies comparing the 2 fields since they would be the same type.
  • Adds omitempty to some NumericString fields : Apple usually do not send empty OriginalTransactionID and the NumericString type fails to parse empty strings. If we Marshall->Unmarshall a struct with NumericString in it, it fails since we produce an empty string when Marshalling. An alternative would be to not fail when parsing an empty string, but I'm not sure this is a wanted change but feel free to ask me to do it !

Thanks a lot for checking this PR !

@jbgosselin
Copy link
Contributor Author

This is related to #185

@richzw richzw requested review from richzw and takecy December 11, 2023 04:03
Copy link
Collaborator

@richzw richzw left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for your PR

@richzw
Copy link
Collaborator

richzw commented Dec 11, 2023

@takecy , Could you please draft one new release for this PR?

Copy link
Member

@takecy takecy left a comment

Choose a reason for hiding this comment

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

Thanks for your PR :)
Looks good to me ☺️
I will create a release.

@takecy takecy merged commit 8dbcb14 into awa:master Dec 11, 2023
4 checks passed
@takecy
Copy link
Member

takecy commented Dec 11, 2023

Please check the release ☺️
https://github.com/awa/go-iap/releases/tag/v1.26.1

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

Successfully merging this pull request may close these issues.

3 participants