Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Support optional properties on operation payloads #66

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

davidgrayston-paddle
Copy link
Contributor

@davidgrayston-paddle davidgrayston-paddle commented Nov 8, 2024

Changed

  • Transaction and Subscription operation items now allow optional properties to be omitted.
    • The following property types have changed
      • paddle_billing.Resources.Subscriptions.Operations:
        • UpdateSubscription.items
        • PreviewUpdateSubscription.items
        • CreateOneTimeCharge.items
        • PreviewOneTimeCharge.items
      • paddle_billing.Resources.Transactions.Operations:
        • CreateTransaction.items
        • UpdateTransaction.items
        • PreviewTransactionByAddress.items
        • PreviewTransactionByCustomer.items
        • PreviewTransactionByIP.items
  • Transaction and Subscription preview responses now support preview products and prices without IDs

Upgrade Notes

2. Transaction and Subscription operation items now allow optional properties to be omitted.

Transaction and Subscription operation item types have changed to new types that allow optional properties to be omitted.

  • paddle_billing.Resources.Subscriptions.Operations UpdateSubscription and PreviewUpdateSubscription items are now list of:
    • paddle_billing.Resources.Subscriptions.Operations.Update.SubscriptionUpdateItem
    • paddle_billing.Resources.Subscriptions.Operations.Update.SubscriptionUpdateItemWithPrice
  • paddle_billing.Resources.Subscriptions.Operations CreateOneTimeCharge and PreviewOneTimeCharge items are now list of:
    • paddle_billing.Resources.Subscriptions.Operations.Charge.SubscriptionChargeItem
    • paddle_billing.Resources.Subscriptions.Operations.Charge.SubscriptionChargeItemWithPrice
  • paddle_billing.Resources.Transactions.Operations.CreateTransaction.items is now list of:
    • paddle_billing.Resources.Transactions.Operations.Create.TransactionCreateItem
    • paddle_billing.Resources.Transactions.Operations.Create.TransactionCreateItemWithPrice
  • paddle_billing.Resources.Transactions.Operations.UpdateTransaction.items is now list of:
    • paddle_billing.Resources.Transactions.Operations.Update.TransactionUpdateItem
    • paddle_billing.Resources.Transactions.Operations.Update.TransactionUpdateItemWithPrice
  • paddle_billing.Resources.Transactions.Operations PreviewTransactionByAddress, PreviewTransactionByCustomer and PreviewTransactionByIP items are now list of:
    • paddle_billing.Resources.Transactions.Operations.Preview.TransactionItemPreviewWithNonCatalogPrice
    • paddle_billing.Resources.Transactions.Operations.Preview.TransactionItemPreviewWithPriceId

The following classes have been removed:

  • paddle_billing.Entities.Subscriptions:
    • SubscriptionItems
      • replaced by paddle_billing.Resources.Subscriptions.Operations.Update.SubscriptionUpdateItem
    • SubscriptionItemsWithPrice
      • replaced by paddle_billing.Resources.Subscriptions.Operations.Update.SubscriptionUpdateItemWithPrice
    • SubscriptionNonCatalogPrice
      • replaced by paddle_billing.Resources.Subscriptions.Operations.Price.SubscriptionNonCatalogPrice
    • SubscriptionNonCatalogPriceWithProduct
      • replaced by paddle_billing.Resources.Subscriptions.Operations.Price.SubscriptionNonCatalogPriceWithProduct
    • SubscriptionNonCatalogProduct
      • replaced by paddle_billing.Resources.Subscriptions.Operations.Price.SubscriptionNonCatalogProduct
  • paddle_billing.Entities.Transactions:
    • TransactionCreateItem
      • replaced by:
        • paddle_billing.Resources.Transactions.Operations.Create.TransactionCreateItem (for create)
        • paddle_billing.Resources.Transactions.Operations.Update.TransactionUpdateItem (for update)
    • TransactionCreateItemWithPrice
      • replaced by:
        • paddle_billing.Resources.Transactions.Operations.Create.TransactionCreateItemWithPrice (for create)
        • paddle_billing.Resources.Transactions.Operations.Update.TransactionUpdateItemWithPrice (for update)
    • TransactionNonCatalogPrice
      • replaced by paddle_billing.Resources.Transactions.Operations.Price.TransactionNonCatalogPrice
    • TransactionNonCatalogPriceWithProduct
      • replaced by paddle_billing.Resources.Transactions.Operations.Price.TransactionNonCatalogPriceWithProduct
    • TransactionNonCatalogProduct
      • replaced by paddle_billing.Resources.Transactions.Operations.Price.TransactionNonCatalogProduct
    • TransactionItemPreviewWithNonCatalogPrice
      • replaced by paddle_billing.Resources.Transactions.Operations.Preview.TransactionItemPreviewWithNonCatalogPrice
    • TransactionItemPreviewWithPriceId
      • replaced by paddle_billing.Resources.Transactions.Operations.Preview.TransactionItemPreviewWithPriceId

3. Transaction and Subscription preview responses now support preview products and prices without IDs

  • SubscriptionPreview.immediate_transaction.details.line_items[].price_id can now be None
  • SubscriptionPreview.immediate_transaction.details.line_items[].product is now paddle_billing.Entities.Shared.TransactionPreviewProduct
  • SubscriptionPreview.next_transaction.details.line_items[].price_id can now be None
  • SubscriptionPreview.next_transaction.details.line_items[].product is now paddle_billing.Entities.Shared.TransactionPreviewProduct
  • SubscriptionPreview.recurring_transaction_details.line_items[].price_id can now be None
  • SubscriptionPreview.recurring_transaction_details.line_items[].product is now paddle_billing.Entities.Shared.TransactionPreviewProduct
  • TransactionPreview.items[].price is now TransactionPreviewPrice
  • TransactionPreview.details.line_items[].price_id can now be None
  • TransactionPreview.details.line_items[].product is now paddle_billing.Entities.Shared.TransactionPreviewProduct

@davidgrayston-paddle davidgrayston-paddle merged commit 5c2b15d into main Nov 11, 2024
6 checks passed
@davidgrayston-paddle davidgrayston-paddle deleted the fix/transaction-optional-properties branch November 11, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants