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

Error getting checkout list #24

Closed
woutercouvaras opened this issue Mar 21, 2024 · 1 comment
Closed

Error getting checkout list #24

woutercouvaras opened this issue Mar 21, 2024 · 1 comment

Comments

@woutercouvaras
Copy link

Hi,

I've only just come across your library, so thanks for putting in the effort to build this!

I'm very, very new to Go (coming from Node land), so i've not put in a PR, because I'm not 100% sure if I'm understanding this correctly.

When I try to get a list of checkouts, here's my code:

checkouts, response, err := client.Checkouts.List(context.Background())
if err != nil {
     return err
}

// I have print statements right after, but it's failing before it gets to the print statements

I get the following error:

json: cannot unmarshal array into Go struct field CheckoutData.data.attributes.checkout_data.custom of type map[string]interface {}

When I look at the expected reponse in lemonsqueezy docs, it looks like they return an array for heckoutData.data.attributes.checkout_data.custom, and when I look at the type, it looks like we're expecting a map:

Custom map[string]any `json:"custom"`

Is this correct, or am I misunderstanding something (if I am, I'm sorry to waste your time)?

@AchoArnold
Copy link
Member

The issue has been fixed @woutercouvaras. Update to the latest version of this library.

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