From 130f8e49cab16aeb0ab2dcc2550aea3f33ffba1a Mon Sep 17 00:00:00 2001 From: Sysix Date: Sun, 11 Feb 2024 05:40:30 +0100 Subject: [PATCH] fix voucher file upload path --- src/Clients/Voucher.php | 2 +- tests/Clients/VoucherTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Clients/Voucher.php b/src/Clients/Voucher.php index 2ed2a23..b048360 100644 --- a/src/Clients/Voucher.php +++ b/src/Clients/Voucher.php @@ -33,7 +33,7 @@ public function upload(string $id, string $filepath): ResponseInterface 'file' => fopen($filepath, 'r') ]); - $api = $this->api->newRequest('POST', $this->resource . '/' . rawurlencode($id), [ + $api = $this->api->newRequest('POST', $this->resource . '/' . rawurlencode($id) . '/files', [ 'Content-Type' => 'multipart/form-data; boundary=' . $body->getBoundary() ]); diff --git a/tests/Clients/VoucherTest.php b/tests/Clients/VoucherTest.php index d0a7021..e2ea6fd 100644 --- a/tests/Clients/VoucherTest.php +++ b/tests/Clients/VoucherTest.php @@ -125,7 +125,7 @@ public function testUploadSuccess(): void $this->assertEquals('POST', $api->getRequest()->getMethod()); $this->assertEquals( - $api->apiUrl . '/v1/vouchers/resource-id', + $api->apiUrl . '/v1/vouchers/resource-id/files', $api->getRequest()->getUri()->__toString() );