verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

NZ Post authentication error #135

Closed krisMoca closed 1 month ago

krisMoca commented 3 months ago

Describe the bug

I have a correct client id and client secret as I can login via website of nz post.

When I used the plugin it's throwing an error. I wonder if the endpoint is wrong? image

I can login via website image

Steps to reproduce

  1. Login to CP
  2. Create a new provider. Postie > Providers > New Provider
  3. Enter Client ID and Client secret
  4. Test rates

Craft CMS version

5.10.0

Plugin version

"verbb/postie": "dev-craft-4 as 4.0.3"

Multi-site?

Yes

Additional context

No response

engram-design commented 3 months ago

According to their docs oauth.nzpost.co.nz is correct.

I see in the debug output that the client secret is NZ_POST_CLIENT_SECRET - I just wanted to check if that's something you've just swapped in for the sake of posting here, or if that's an incorrect reference to an .env variable?

krisMoca commented 3 months ago

Hi I used env variables to to set the client id and secret, and the references were correct.

When I set it up directly and clicked on "Test Rates" I've got a different error. image

engram-design commented 3 months ago

Looks like the error response is being truncated, which I've updated for the next release. To get this early, run composer require verbb/postie:"dev-craft-4 as 4.0.4". If you could try that, I'd be interested what the full error message here is.

In addition, would it be possible to gain your client ID/Secret (privately) for testing? I have an existing client that's working on my end, so I just wanted to ensure it's nothing to do with your client. If you're able to, send to support@verbb.io.

engram-design commented 1 month ago

Fixed in 4.0.5