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

Cannot set OriginalTransactionID in ReceiptForIOS6 type using same field from InApp due to type mismatch #185

Open
austinhess opened this issue Feb 20, 2023 · 0 comments

Comments

@austinhess
Copy link

austinhess commented Feb 20, 2023

Hello, we are trying to use fields from a Receipt and an InApp to create a ReceiptForIOS6 . We are attempting to set the ReceiptForIOS6 based on latestReceipt *InApp as follows:

ReceiptForIOS6{
    ... setting other fields
    OriginalTransactionID: latestReceipt.OriginalTransactionID,
    ...
}

but get a type mismatch error, as latestReceipt.OriginalTransactionID is a string, but a numericString is provided by the InApp object. Because numericString is a private type, we cannot cast to it or otherwise generate a new numericString (even with proper validation). To address this issue previously, we have forked this repo to make numericString a public type, but would prefer to use this main repo so as to not miss out on important updates. We would hope that one of the following options would be acceptable to resolve this issue, and if so, we can submit a PR to do so:

  • Making numericString a public type NumericString
  • Making a new public function, such as GetNumericStringFromString(input string) (numericString, error) that allows us to get an instance of this type, possibly subject to the same validation as in the UnmarshalJSON function
  • If the ReceiptForIOS6 OriginalTransactionID field type is unnecessarily specific, it could be changed to a string type, or if the InApp type should be requiring a numeric string for that field, that field could be updated to be a numericString.

We would prefer the first option. This issue may be related to #160, but more details would be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants