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

I only have one transactionId, but I’m not sure whether it’s a sandbox or a production environment. How to get the subscription plan? #76

Closed
hakusai22 opened this issue Mar 25, 2024 · 2 comments

Comments

@hakusai22
Copy link
Contributor

Hello, I have a scenario that I would like to consult. I have a transactionId, but I am not sure whether it is a sandbox or a production environment. I don’t know which environment to get its subscription plan. Do you have any solutions here?

@alexanderjordanbaker
Copy link
Collaborator

Generally we always recommend passing an environment around with a transaction id to help prevent this issue! But these cases definitely happen, and a good way to approach this is to call the Get Transaction Info endpoint (https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info) in production, and if you receive a 404 TransactionIdNotFoundError, call the same endpoint in Sandbox and see if a non-404 response is returned.

@hakusai22
Copy link
Contributor Author

hakusai22 commented Mar 30, 2024

Generally we always recommend passing an environment around with a transaction id to help prevent this issue! But these cases definitely happen, and a good way to approach this is to call the Get Transaction Info endpoint (https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info) in production, and if you receive a 404 TransactionIdNotFoundError, call the same endpoint in Sandbox and see if a non-404 response is returned.

My side now requests the online environment first. If an exception occurs TRANSACTION_ID_NOT_FOUND(4040010L), I will call the sandbox environment again to obtain the subscription information, The way you said it is the same as mine.
image

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

No branches or pull requests

2 participants