diff --git a/CHANGELOG.md b/CHANGELOG.md index f176786..38bf6c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,15 +6,30 @@ 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-go-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools. -## 0.5.0 - +## 0.5.0 - 2024-07-26 ### Breaking changes - Paddle API enum types are now correctly enforced where applicable +- Notifications and Events `EventType` property now use `EventTypeName` instead of `string` type +- `Totals` is now a unified type from the previous 4 types `Totals`, `TotalsFormatted`, `UnitTotals` and `UnitTotalsFormatted` +- Various types have been renamed to be less generic and lower the risk of a future breaking change, see [UPGRADING](./UPGRADING.md) for details ### Added - `Product` has been added as a property of `SubscriptionItem` +- `TaxRatesUsed` has been added as a property of `Adjustments` and `AdjustmentNotification` +- `Notification` property `Type` narrows to `EventTypeName` from `string` +- All notifications and events now have `EventType` narrowed to `EventTypeName` from `string` + +### Fixed + +- Handling collections for API endpoints without pagination +- `UnitPriceOverride` property `CountryCodes` is now typed as a slice +- `Transaction` property `AvailablePaymentMethods` is now typed as a slice +- `PricePreview` property `AvailablePaymentMethods` is now typed as a slice +- `CreateNotificationSettingRequest` property `SubscribedEvents` is now correctly typed +- `UpdateNotificationSettingRequest` property `SubscribedEvents` is now correctly typed ## 0.4.0 - 2024-06-26 diff --git a/UPGRADING.md b/UPGRADING.md index cefbee6..aa67d03 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -16,6 +16,64 @@ priceUpdate := &paddle.UpdatePriceRequest{Status: paddle.NewPatchField("archived priceUpdate := &paddle.UpdatePriceRequest{Status: paddle.NewPatchField(paddle.StatusArchived)} ``` +2. Notifications and Events `EventType` property now use `EventTypeName` instead of `string` type. + +Any functions this property is passed into will need to be updated accordingly. + +3. `Totals` is now a unified type from the previous 4 types `Totals`, `TotalsFormatted`, `UnitTotals` and `UnitTotalsFormatted` + +The type shape is the same however receiving functions will need to be updated accordingly. + +Any usage of the following types may cause breakages. + +| Package | Type | +|----------------------|-------------------------------------------| +| `paddlenotification` | `TransactionLineItem` | +| `paddle` | `PricePreviewLineItem` | +| `paddle` | `TransactionLineItem` | +| `paddle` | `SubscriptionsTransactionLineItemPreview` | +| `paddle` | `TransactionLineItemPreview` | + +4. Various types have been renamed to be less generic and lower the risk of a future breaking change + +| Previous Type | New Type | +|------------------------------------|-------------------------------------| +| `Action` | `AdjustmentAction` | +| `IPAddressesData` | `IPAddress` | +| `Origin` | `NotificationOrigin` | +| `SubscriptionsCatalogItem` | `SubscriptionsUpdateCatalogItem` | +| `ResultAction` | `UpdateSummaryResultAction` | +| `Result` | `UpdateSummaryResult` | +| `PreviewSubscriptionUpdateSummary` | `SubscriptionPreviewUpdateSummary` | +| `Breakdown` | `AdjustmentsTotalsBreakdown` | +| `PreviewSubscriptionRequest` | `PreviewSubscriptionUpdateRequest` | +| `PreviewTransactionRequest` | `PreviewTransactionCreateRequest` | +| `CountryAndZipPostalCode` | `TransactionPreviewByAddress` | +| `CountryAndZipPostalCodeItems` | `TransactionPreviewByAddressItems` | +| `IPAddress` | `TransactionPreviewByIP` | +| `IPAddressItems` | `TransactionPreviewByIPItems` | +| `ExistingCustomerPaddleIDs` | `TransactionPreviewByCustomer` | +| `ExistingCustomerPaddleIDsItems` | `TransactionPreviewByCustomerItems` | + +Alongside these type changes some functions have been respectively updated and any usages will need to be changed in your codebase. + +| Previous Function Name | New Function Name | +|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------| +| `NewCountryAndZipPostalCodeItemsTransactionsCatalogItem` | `NewTransactionPreviewByAddressItemsTransactionsCatalogItem` | +| `NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceForAnExistingProduct` | `NewTransactionPreviewByAddressItemsTransactionsNonCatalogPriceForAnExistingProduct` | +| `NewCountryAndZipPostalCodeItemsTransactionsNonCatalogPriceAndProduct` | `NewTransactionPreviewByAddressItemsTransactionsNonCatalogPriceAndProduct` | +| `NewIPAddressItemsTransactionsCatalogItem` | `NewTransactionPreviewByIPItemsTransactionsCatalogItem` | +| `NewIPAddressItemsTransactionsNonCatalogPriceForAnExistingProduct` | `NewTransactionPreviewByIPItemsTransactionsNonCatalogPriceForAnExistingProduct` | +| `NewIPAddressItemsTransactionsNonCatalogPriceAndProduct` | `NewTransactionPreviewByIPItemsTransactionsNonCatalogPriceAndProduct` | +| `NewExistingCustomerPaddleIDsItemsTransactionsCatalogItem` | `NewTransactionPreviewByCustomerItemsTransactionsCatalogItem` | +| `NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceForAnExistingProduct` | `NewTransactionPreviewByCustomerItemsTransactionsNonCatalogPriceForAnExistingProduct` | +| `NewExistingCustomerPaddleIDsItemsTransactionsNonCatalogPriceAndProduct` | `NewTransactionPreviewByCustomerItemsTransactionsNonCatalogPriceAndProduct` | +| `NewCreateSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem` | `NewCreateSubscriptionChargeItemsSubscriptionsCatalogItem` | +| `NewPreviewSubscriptionChargeItemsSubscriptionsSubscriptionsCatalogItem` | `NewPreviewSubscriptionChargeItemsSubscriptionsCatalogItem` | +| `PreviewSubscription` | `PreviewSubscriptionUpdate` | +| `PreviewTransaction` | `PreviewTransactionCreate` | + + ## v0.4.0 1. This version includes a breaking change to shared types between Transactions and Subscriptions resources which have now been split into their own respective types.