Skip to content

Commit 8fa73e4

Browse files
authored
Merge pull request #152 from Sysix/fix-file-voucher-upload
fix voucher file upload path
2 parents b0f4448 + 130f8e4 commit 8fa73e4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Clients/Voucher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function upload(string $id, string $filepath): ResponseInterface
3333
'file' => fopen($filepath, 'r')
3434
]);
3535

36-
$api = $this->api->newRequest('POST', $this->resource . '/' . rawurlencode($id), [
36+
$api = $this->api->newRequest('POST', $this->resource . '/' . rawurlencode($id) . '/files', [
3737
'Content-Type' => 'multipart/form-data; boundary=' . $body->getBoundary()
3838
]);
3939

tests/Clients/VoucherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testUploadSuccess(): void
125125

126126
$this->assertEquals('POST', $api->getRequest()->getMethod());
127127
$this->assertEquals(
128-
$api->apiUrl . '/v1/vouchers/resource-id',
128+
$api->apiUrl . '/v1/vouchers/resource-id/files',
129129
$api->getRequest()->getUri()->__toString()
130130
);
131131

0 commit comments

Comments
 (0)