-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Add support for transaction update items with optional properties
- Loading branch information
1 parent
f983c60
commit 7f50dff
Showing
22 changed files
with
645 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/Resources/Transactions/Operations/Price/TransactionNonCatalogProduct.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Paddle\SDK\Resources\Transactions\Operations\Price; | ||
|
||
use Paddle\SDK\Entities\Shared\CustomData; | ||
use Paddle\SDK\Entities\Shared\TaxCategory; | ||
use Paddle\SDK\FiltersUndefined; | ||
use Paddle\SDK\Undefined; | ||
|
||
class TransactionNonCatalogProduct implements \JsonSerializable | ||
{ | ||
use FiltersUndefined; | ||
|
||
public function __construct( | ||
public string $name, | ||
public TaxCategory $taxCategory, | ||
public string|Undefined|null $description = new Undefined(), | ||
public string|Undefined|null $imageUrl = new Undefined(), | ||
public CustomData|Undefined|null $customData = new Undefined(), | ||
) { | ||
} | ||
|
||
public function jsonSerialize(): array | ||
{ | ||
return $this->filterUndefined([ | ||
'name' => $this->name, | ||
'description' => $this->description, | ||
'tax_category' => $this->taxCategory, | ||
'image_url' => $this->imageUrl, | ||
'custom_data' => $this->customData, | ||
]); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Resources/Transactions/Operations/Update/TransactionUpdateItem.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Paddle\SDK\Resources\Transactions\Operations\Update; | ||
|
||
class TransactionUpdateItem | ||
{ | ||
public function __construct( | ||
public string $priceId, | ||
public int $quantity, | ||
) { | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Resources/Transactions/Operations/Update/TransactionUpdateItemWithPrice.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Paddle\SDK\Resources\Transactions\Operations\Update; | ||
|
||
use Paddle\SDK\Resources\Transactions\Operations\Price\TransactionNonCatalogPrice; | ||
use Paddle\SDK\Resources\Transactions\Operations\Price\TransactionNonCatalogPriceWithProduct; | ||
|
||
class TransactionUpdateItemWithPrice | ||
{ | ||
public function __construct( | ||
public TransactionNonCatalogPrice|TransactionNonCatalogPriceWithProduct $price, | ||
public int $quantity, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.