LauLamanApps / iZettleApi

iZettle Api php intergration
MIT License
12 stars 15 forks source link

fromEventLogUuid can be null #18

Closed torkiljohnsen closed 6 years ago

torkiljohnsen commented 6 years ago

When testing I discovered this:

ProductClient->getLibrary() does $this->libraryBuilder->buildFromJson($json).

The $json in this case is the JSON return from my iZettle API, and it looks something like this:

{"untilEventLogUuid":"945eb480-4233-11e8-872a-73e6dfd45eb4","fromEventLogUuid":null,"products":[{"uuid":"4fa03a80-936c-11e5-a0be-5cd6168eb23a",…

As you can see, fromEventLogUuid is null, but the LibraryBuilder class' constructor incorrectly assumes that this is a UUID, when it can obviously also be null.

This exception is thrown: Ramsey\\Uuid\\Exception\\InvalidUuidStringException(code: 0): Invalid UUID string:…

From iZettle's docs, it says that fromEventLogUuid should be a string, so I will report this with iZettle as well.

LauLaman commented 6 years ago

@torkiljohnsen thanks for reporting this can you provide me with the full JSON return? (please anonymise sensitive data)

Due to the limited iZettle API docs, a lot of builders are created by the responses i got

torkiljohnsen commented 6 years ago

Sorry, I have not looked at this for months. We have built our own client for this I'm afraid.

LauLaman commented 6 years ago

@torkiljohnsen no problem, as you mentions you contacted iZettle about this problem, can you tell me the outcome for this issue?

thanks

torkiljohnsen commented 6 years ago

Huh? There should be a link just above here to the referenced issue? https://github.com/iZettle/api-documentation/issues/44

pazion commented 6 years ago

We have the same problem with null value in field fromEventLogUuid from json return. Part of the json which breaks in LibraryBuilder::buildFromJson:

....13e275741638","fromEventLogUuid":null,"products":[{"uuid":"f0.....

LauLaman commented 6 years ago

Will be fixed with next release