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

Gumroad API Break Changes #33

Open
dwisiswant0 opened this issue Feb 4, 2024 · 2 comments · May be fixed by #34
Open

Gumroad API Break Changes #33

dwisiswant0 opened this issue Feb 4, 2024 · 2 comments · May be fixed by #34

Comments

@dwisiswant0
Copy link

dwisiswant0 commented Feb 4, 2024

          I was just about to ask the same thing a sec ago. Checking out the docs, it seems like they're asking for `product_id` instead of `product_permalink` to verify the license. Can you quickly confirm if this package is still on point, @caarlos0? Thanks!

Originally posted by @dwisiswant0 in #32 (comment)

Turns out, it doesn't work:

license: invalid license: The 'product_id' parameter is required to verify the license for this product. Please set 'product_id' to '[REDACTED]' in the request.

Gumroad Notice: https://help.gumroad.com/article/76-license-keys#verification

dwisiswant0 added a commit to dwisiswant0/go-gumroad that referenced this issue Feb 4, 2024
This commit introduces breaking changes to the `Product` struct & `NewProduct` func:

* Deprecated the **Product** field in the `Product` struct.
* Added **ID** field in the `Product` struct as replacement for **Product** field.
* Updated the `NewProduct` function to accept & use product ID instead of the product permalink[^1].
* Modified the `VerifyWithContext` method to use **product_id**[^1] parameter instead of **product_permalink** in the API req body.

Fix caarlos0#33

[^1]: https://help.gumroad.com/article/76-license-keys#verification

Signed-off-by: Dwi Siswanto <me@dw1.io>
@dwisiswant0 dwisiswant0 linked a pull request Feb 4, 2024 that will close this issue
@caarlos0
Copy link
Owner

caarlos0 commented Feb 4, 2024

it seems it depends on the product, tested one of mine, still working

❯ curl -sfXPOST https://api.gumroad.com/v2/licenses/verify -d "product_permalink=goreleaser" -d "license_key=[REDACTED]" | jq .
{
  "success": true,
  "uses": 4131,
  "purchase": {
...

so just changing the lib to use product_id instead doesn't seem like a good idea

Maybe changing NewProduct to accept a struct that may contain either the product id or permalink, or make a new NewProductFromID or similar

@dwisiswant0
Copy link
Author

Maybe changing NewProduct to accept a struct that may contain either the product id or permalink, or make a new NewProductFromID or similar

Agree with this.

it seems it depends on the product, tested one of mine, still working

I think it is. Product ID only needed for "products created on or after Jan 9, 2023."

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

Successfully merging a pull request may close this issue.

2 participants