Skip to content

Commit

Permalink
fix: Fix TransactionPDF endpoint should be /transactions/{$id}/invoice
Browse files Browse the repository at this point in the history
docs(release): 0.2.2 release

---------

Co-authored-by: Corey <regan.corey@gmail.com>
  • Loading branch information
mikeymike and Invincibear authored Jan 29, 2024
1 parent 4c4032e commit 3631f94
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Transactions/TransactionsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
];
}
}

0 comments on commit 3631f94

Please sign in to comment.