Skip to content

Commit

Permalink
Merge pull request #152 from Sysix/fix-file-voucher-upload
Browse files Browse the repository at this point in the history
fix voucher file upload path
  • Loading branch information
Sysix committed Feb 11, 2024
2 parents b0f4448 + 130f8e4 commit 8fa73e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Clients/Voucher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
]);

Expand Down
2 changes: 1 addition & 1 deletion tests/Clients/VoucherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);

Expand Down

0 comments on commit 8fa73e4

Please sign in to comment.