Open Bevilacqua opened 1 week ago
The errors are custom error, you could find more details from here https://github.com/awa/go-iap/blob/master/appstore/api/error.go. You could fetch the error code through ErrorCode()
@Bevilacqua
Sample codes
func (c *APIClient) Verify(ctx context.Context, transactionId string) (interface{}, error) {
result, err := c.productionCli.GetTransactionInfo(ctx, transactionId)
if err != nil && errors.Is(err, TransactionIdNotFoundError) {
result, err = c.sandboxCli.GetTransactionInfo(ctx, transactionId)
}
https://github.com/awa/go-iap/blob/master/appstore/api/validator.go#L26 @Bevilacqua
The README explains:
How do you actually check the error code? The function only returns the response (which will be nil when there is an error) and an error. The error has the code embedded in the error string but is there a straight forward way to check what error code so we know when to try again with the sandbox URL?