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: Transaction Preview Price #89

Merged
merged 3 commits into from
Oct 9, 2024

Conversation

davidgrayston-paddle
Copy link
Contributor

@davidgrayston-paddle davidgrayston-paddle commented Oct 7, 2024

Fixed

  • TransactionsClient::preview() TransactionPreview response now allows null price ID for non-catalog prices:
    • TransactionPreview items[]->price can now return Price (with id) or TransactionPreviewPrice (with nullable id)
    • TransactionPreview details->lineItems[]->priceId is now nullable

Added

  • TransactionsClient::create() now supports operation items with optional properties:
    • Resources\Transactions\Operations\Create\TransactionCreateItem
    • Resources\Transactions\Operations\Create\TransactionCreateItemWithPrice
  • TransactionsClient::update() now supports operation items with optional properties:
    • Resources\Transactions\Operations\Update\TransactionUpdateItem
    • Resources\Transactions\Operations\Update\TransactionUpdateItemWithPrice
  • TransactionsClient::preview() now supports operation items with optional properties:
    • Resources\Transactions\Operations\Preview\TransactionItemPreviewWithNonCatalogPrice
    • Resources\Transactions\Operations\Preview\TransactionItemPreviewWithPriceId

Deprecated

  • TransactionsClient::create() operation items have been deprecated:
    • Entities\Transaction\TransactionCreateItem
    • Entities\Transaction\TransactionCreateItemWithPrice
  • TransactionsClient::update() operation items have been deprecated:
    • Entities\Transaction\TransactionUpdateTransactionItem
  • TransactionsClient::preview() operation items have been deprecated:
    • Entities\Transaction\TransactionItemPreviewWithNonCatalogPrice
    • Entities\Transaction\TransactionItemPreviewWithPriceId

Relates to #87 and #88

@davidgrayston-paddle davidgrayston-paddle force-pushed the fix/transaction-preview-price branch from 7f50dff to 0b39445 Compare October 7, 2024 20:17
@@ -16,7 +16,7 @@
class TransactionItemPreviewWithPrice
{
private function __construct(
public Price $price,
public Price|TransactionPreviewPrice $price,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make this TransactionPreviewPrice only?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just TransactionPreviewPrice would make it breaking so lets stick with the union 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The non catalog prices are shared between operations, so have put them in their own namespace Paddle\SDK\Resources\Transactions\Operations\Price

@davidgrayston-paddle davidgrayston-paddle marked this pull request as ready for review October 8, 2024 11:13
@davidgrayston-paddle davidgrayston-paddle requested a review from a team as a code owner October 8, 2024 11:13
@davidgrayston-paddle davidgrayston-paddle merged commit 807fd31 into main Oct 9, 2024
4 checks passed
@davidgrayston-paddle davidgrayston-paddle deleted the fix/transaction-preview-price branch October 9, 2024 11:20
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