Skip to content

Commit 7159c69

Browse files
feat: add exchangeRate and feeRate to transaction payout totals (#138)
1 parent fb5dabb commit 7159c69

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
1212

1313
This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
1414

15+
## 2.7.2 - 2025-05-22
16+
17+
### Fixed
18+
19+
- Added support for `exchangeRate` and `feeRate` in transaction completed webhook event's `details.payoutTotals`
20+
21+
---
22+
1523
## 2.7.1 - 2025-05-07
1624

1725
### Changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@paddle/paddle-node-sdk",
3-
"version": "2.7.1",
3+
"version": "2.7.2",
44
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
55
"main": "dist/cjs/index.cjs.node.js",
66
"module": "dist/esm/index.esm.node.js",

src/__tests__/mocks/notifications/transaction-completed.mock.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ export const TransactionCompletedMock: IEventsResponse<ITransactionNotificationR
159159
subtotal: '59900',
160160
grand_total: '65215',
161161
currency_code: 'USD',
162+
exchange_rate: '1',
163+
fee_rate: '0.05',
162164
},
163165
tax_rates_used: [
164166
{ totals: { tax: '5315', total: '65215', discount: '0', subtotal: '59900' }, tax_rate: '0.08875' },
@@ -382,6 +384,8 @@ export const TransactionCompletedMockExpectation = {
382384
subtotal: '59900',
383385
tax: '5315',
384386
total: '65215',
387+
exchangeRate: '1',
388+
feeRate: '0.05',
385389
},
386390
taxRatesUsed: [
387391
{

src/notifications/entities/shared/transaction-payout-totals-notification.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export class TransactionPayoutTotalsNotification {
1919
public readonly fee: string;
2020
public readonly earnings: string;
2121
public readonly currencyCode: PayoutCurrencyCode;
22+
public readonly exchangeRate: string;
23+
public readonly feeRate: string;
2224

2325
constructor(transactionPayoutTotals: ITransactionPayoutTotalsNotificationResponse) {
2426
this.subtotal = transactionPayoutTotals.subtotal;
@@ -32,5 +34,7 @@ export class TransactionPayoutTotalsNotification {
3234
this.fee = transactionPayoutTotals.fee;
3335
this.earnings = transactionPayoutTotals.earnings;
3436
this.currencyCode = transactionPayoutTotals.currency_code;
37+
this.exchangeRate = transactionPayoutTotals.exchange_rate;
38+
this.feeRate = transactionPayoutTotals.fee_rate;
3539
}
3640
}

src/notifications/types/shared/transaction-payout-totals-notification-response.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ export interface ITransactionPayoutTotalsNotificationResponse {
1818
fee: string;
1919
earnings: string;
2020
currency_code: PayoutCurrencyCode;
21+
exchange_rate: string;
22+
fee_rate: string;
2123
}

0 commit comments

Comments
 (0)