LauLamanApps / iZettleApi

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

Adding optional headers to handle rfc7386 required for some API calls #50

Open carsso opened 2 years ago

carsso commented 2 years ago

Adding optional headers to handle rfc7386 (JSON merge patch through HttpHeaders.IF_MATCH header) required for some API calls (like /organizations/{organizationUuid}/products/v2/{productUuid})

Can be used like this $guzzleIzettleClient->put($url, $data, ['If-Match' => '*']);

LauLaman commented 2 years ago

Hi @carsso

Great work! can you fix the broken tests? so we can get this merged

carsso commented 2 years ago

Hi @LauLaman

Sorry, I completely forgot about this PR. I updated guzzle for one of my projects.

Newer guzzle version specifies return types in functions signatures. So when mocking we have to go ont step further to match return types, that's why it was failing.

Tests are now fixed (and passing for guzzle 6.3 and 7.3). I also fixed the 2 small failures on uuid since #48

I never used scrutinizer before so I don't know how to ask it to test both versions to make sur we don't break guzzle 6.3 in the future.

carsso commented 2 years ago

@LauLaman Hi, is there any chance to get this PR merged ? Thanks

carsso commented 1 month ago

hello @LauLaman Is is possible to merge that PR ? I rebasesd on master, fixed the conflicts, phpunit and phpcs : See https://github.com/carsso/iZettleApi/actions/runs/10408737052