sumup / sumup-go

Go SDK for SumUp API.
https://developer.sumup.com
Apache License 2.0
7 stars 1 forks source link

Query parameter missing in api calls #1

Open Noroth opened 4 days ago

Noroth commented 4 days ago

I noticed that the ListCheckouts function is not working for me. I took a look at the code of functions that require query parameters and it seems that those parameters are not passed to the API.

E.g.: params is unused in the function. Also applies to other functions

https://github.com/sumup/sumup-go/blob/665a7e60f6f310f9656407d5a10260be9830a209/checkouts.go#L798-L801

DrissiReda commented 3 days ago

For me it always returns an empty list, even if I use this, and I have a bunch of parameters

checkouts, err := client.Checkouts.List(context.Background(), sumup.ListCheckoutsParams{})

did you manage to get this to work? even without parameters.

Another thing for trying refunds, no matter what I do I get error 404 not found

Noroth commented 1 day ago

I compared the calls to simple cURL requests.

To answer your question, I also get an empty list when I don't specify anything in the query. Is this correct? I don't know. We will have to ask the Sumup team here. However, I get a response if I provide a checkout ref with cURL, but not when using the Go SDK.

I haven't tested refunds yet.

Personally, I think that the API could use a few more filter parameters because if I don't somehow save the checkout references that I specify during checkout creation I will have a hard time finding out which of them have already been created and are pending as I am not able to see them somewhere in the dashboard.

I thought the List endpoint would solve this problem for me, but it actually seems to be a GetByCheckoutReference rather than a ListCheckouts functionality. Maybe I'm wrong here and missing something.

DrissiReda commented 1 day ago

@Noroth The API describes it as getting ALL checkouts if nothing is specified. However the only way /checkouts work is getting a single checkout using its reference as a parameter.

It's weird to not have a solution to list every checkout. I contacted integration@sumup.com and they haven't been helpful. They link the API doc as if it's my mistake I've tried multiple times to explain the documentation isn't working as intended and it's been falling on deaf ears.

Can I contact you if you're working on this? Maybe we can progress better together. Get back to me if you're open to that.

Noroth commented 1 day ago

@DrissiReda I'm currently on vacation. I will be back on the 24.10.

Let's see if someone has replied to that issue by then. I am currently only working on a PoC whether we want to integrate Sumup into our system.

We can talk when I'm back home. Is that okay?

DrissiReda commented 1 day ago

Great that works. Working on a PoC for the same reason.