Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ adding additional type guards.

## Unreleased

### Changed

- Updated transaction revision error contract coverage to reflect that server guidance lists `past_due` as a revisable status. The SDK continues to pass server error codes and details through unchanged.

---

## 3.8.0 - 2026-04-20
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paddle/paddle-node-sdk",
"version": "3.8.0",
"version": "3.8.1",
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
"main": "dist/cjs/index.cjs.node.js",
"module": "dist/esm/index.esm.node.js",
Expand Down
24 changes: 24 additions & 0 deletions src/__tests__/internal/base-resource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,30 @@ describe('BaseResource', () => {
}
});

test('passes through transaction revision error details unchanged', async () => {
const detail = "You can't revise a transaction that's not in the status of `billed`, `past_due` or `completed`";
const mockResponse = {
status: 400,
headers: new Map(),
json: jest.fn().mockResolvedValue({
error: {
type: 'request_error',
code: 'transaction_invalid_status_to_revise',
detail,
documentation_url: 'https://developer.paddle.com/errors/transactions/transaction_invalid_status_to_revise',
},
meta: { request_id: 'req_3' },
}),
};

mockFetch.mockResolvedValue(mockResponse);

await expect(resource.trigger('/transactions/txn_1/revise')).rejects.toMatchObject({
code: 'transaction_invalid_status_to_revise',
detail,
});
});

test('successful responses pass through handleResponse', async () => {
const mockResponse = {
status: 200,
Expand Down
Loading