diff --git a/CHANGELOG.md b/CHANGELOG.md index b248be8..60036e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-php-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools. +## [0.2.2] - 2024-01-29 + +### Fixed + +- Fixed PDF invoice for transaction endpoint to correctly hit `/transactions/{transaction_id}/invoice` + ## [0.2.1] - 2024-01-24 ### Added diff --git a/src/Client.php b/src/Client.php index 224dbdb..b5f72ba 100644 --- a/src/Client.php +++ b/src/Client.php @@ -51,7 +51,7 @@ class Client { - private const SDK_VERSION = '0.2.1'; + private const SDK_VERSION = '0.2.2'; public readonly LoggerInterface $logger; public readonly Options $options; diff --git a/src/Resources/Transactions/TransactionsClient.php b/src/Resources/Transactions/TransactionsClient.php index 53b65e7..70b17c7 100644 --- a/src/Resources/Transactions/TransactionsClient.php +++ b/src/Resources/Transactions/TransactionsClient.php @@ -131,7 +131,7 @@ public function preview(PreviewTransaction $operation): TransactionPreview public function getInvoicePDF(string $id): TransactionData { $parser = new ResponseParser( - $this->client->getRaw("/transactions/{$id}/preview"), + $this->client->getRaw("/transactions/{$id}/invoice"), ); return TransactionData::from($parser->getData()); diff --git a/tests/Functional/Resources/Transactions/TransactionsClientTest.php b/tests/Functional/Resources/Transactions/TransactionsClientTest.php index f9bf136..95cb4bc 100644 --- a/tests/Functional/Resources/Transactions/TransactionsClientTest.php +++ b/tests/Functional/Resources/Transactions/TransactionsClientTest.php @@ -496,7 +496,7 @@ public static function getInvoicePDFOperationsProvider(): \Generator { yield 'Default' => [ new Response(200, body: self::readRawJsonFixture('response/get_invoice_pdf_default')), - sprintf('%s/transactions/txn_01hen7bxc1p8ep4yk7n5jbzk9r/preview', Environment::SANDBOX->baseUrl()), + sprintf('%s/transactions/txn_01hen7bxc1p8ep4yk7n5jbzk9r/invoice', Environment::SANDBOX->baseUrl()), ]; } }