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

Invoice Rejected #1

Open
vncastanheira opened this issue Jun 1, 2020 · 2 comments
Open

Invoice Rejected #1

vncastanheira opened this issue Jun 1, 2020 · 2 comments

Comments

@vncastanheira
Copy link

vncastanheira commented Jun 1, 2020

I'm having a little trouble verifying the invoice. The token and the publisher ID were supplied as described:

const unityToken = process.env.UNITY_TOKEN //from kharma_session
const publisherID = process.env.PUBLISHER_ID // from the publisher public profile
const storeClient = new AssetStoreClient(unityToken, publisherID, {
    timeout: 60000
});

But after calling:

storeClient.verifyInvoice(invoice)
                .then(() => message.channel.send('Invoice verified with success!'))
                .catch(reason => {
                    message.channel.send('Invalid code.')
                    console.log(`Invoice Rejected: ${reason}`)
                })

it gives me the following message:

Invoice Rejected: StatusCodeError: 401 - "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>401 Authorization Required</title>\n</head><body>\n<h1>Authorization Required</h1>\n<p>This server could not verify that you\nare authorized to access the document\nrequested. Either you supplied the wrong\ncredentials (e.g., bad password), or your\nbrowser doesn't understand how to supply\nthe credentials required.</p>\n</body></html>\n"

The invoice is also a valid code since I have checked on the publisher page.

Using Node 14.3.0 with Windows 10.

@mukaschultze
Copy link
Owner

mukaschultze commented Jun 1, 2020

I'll be taking a look at that, as for now, I recommend using the official API for invoice validation, it's a safer and more reliable API.

EDIT: Are the other methods working fine?

@vncastanheira
Copy link
Author

I'll be taking a look at that, as for now, I recommend using the official API for invoice validation, it's a safer and more reliable API.

EDIT: Are the other methods working fine?

Alright, I went and use their API. But I haven't actually tested the other methods, that was mostly what I was looking for.

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