Comments (9)
One more thing, The verifyReceipt API has been deprecated as of 5 Jun 2023. Please use App Store Server API instead.
from go-iap.
@MissWho Here are some questions
- What is the status of the response of
httpCli.Do
on the sandbox envrionment?
When I replaced another library, the returned data was normal
-
Could you please tell us some details of the other library? like github repo?
-
Any more details of the request could be helpful for us to debug this issue.
from go-iap.
@MissWho Here are some questions
- What is the status of the response of
httpCli.Do
on the sandbox envrionment?When I replaced another library, the returned data was normal
- Could you please tell us some details of the other library? like github repo?
- Any more details of the request could be helpful for us to debug this issue.
Sorry for waiting for a long time. After multiple checks, it seems to be a resp The incomplete data returned by Body resulted in JSON parsing failure with error code EOF. After adding my own debugging code, the file written to the disk was legal and the data could be parsed normally
file:appstore\validator.go 188line
from go-iap.
@MissWho Thank you for your response. The invalid response JSON data caused the JSON Decode failure, and the invalid JSON data with EOF returned from the test URL. Please correct me if something was misunderstanding.
from go-iap.
@richzw How could EOF occur in the data returned by Apple's server? My own test code using json.Unmarshal can decode it successfully, but when using the original json.NewDecoder, it throws an EOF error. I'm using the same body in both cases. If it weren't for the inclusion of sensitive information, I would have sent you the test code already. I need your help in investigating this issue, as I'm starting to doubt whether it's a problem with my code.
from go-iap.
@MissWho Sorry for misunderstanding of your previous response.
Let's double-check the following
-
The status code of the test URL is 200?
-
The response body could be parsed by
json.Unmarshal
successfully, but failed byjson.NewDecoder(resp.Body).Decode(result)
and the error is EOF. Namely, the following codes
buf, err := io.ReadAll(resp.Body)
if err != nil {
return 0, err
}
err = json.Unmarshal(buf, &result)
if err != nil {
return 0, err
}
could parse the response body successfully.
- Could you please share the response data under compliance requirements? We could do some further investigation. Thanks in advance.
from go-iap.
- HTTP response code is 200.
- The data could be successfully parsed before adding it to json.newdecoder using the provided code.
- Please wait while I organize the request response.
However, there's still a very peculiar issue: if I execute the validation request separately within the main function, this problem doesn't occur. My current application scenario is within a web service's API. There are still many factors contributing to this issue.
from go-iap.
you have already read resp.Body
, which is a ReadCloser
.
Check examples: https://go.dev/play/p/bWjUpqTD7J_0 and https://go.dev/play/p/RJcDug1ecG2
from go-iap.
@MissWho , If the resp.Body
was read more than once, the error EOF could come up.
from go-iap.
Related Issues (20)
- Consider embed jwt.RegisteredClaims to SubscriptionNotificationV2DecodedPayload? HOT 3
- Hope to provide a function to decode JWSRenewalInfo HOT 3
- Consider add error type for request apple store api HOT 1
- PriceIncreaseStatus in JWSRenewalInfoDecodedPayload should be *int32 HOT 6
- Consider implement jwt.Cliams for the structure in path appstore HOT 1
- question related to the naming of playstore VeirfyProduct and VerifySubscriptionV2 methods HOT 2
- AutoRenewStatus const type HOT 1
- 苹果解析ParseSignedTransaction,为什么没有Price HOT 1
- Wrong type of consumptionState field HOT 1
- how to parse transaction id by receipt ?? HOT 3
- ios prod、sandbox验单 HOT 5
- offerDiscountType is missing in JWSTransactionDecodedPayload HOT 2
- Is there more detail error msg when verify google iap HOT 4
- can not connect https://oauth2.googleapis.com/token HOT 1
- appstore api: return status code 401 HOT 12
- How do you validate a Google Pay token for a sandbox? HOT 4
- Sandbox 401 error by appstore server api HOT 4
- IOS server api refund transaction revocation reason gives unexpected value HOT 10
- How to parse V2Notification from signedPayload HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-iap.