Skip to content

Commit

Permalink
Merge pull request #805 from quazardous/v5.0-compat
Browse files Browse the repository at this point in the history
[v5] Fix enum constants
  • Loading branch information
iajrz authored Nov 5, 2024
2 parents fae1acb + 0cedc4c commit 1ae7a24
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
22 changes: 14 additions & 8 deletions lib/Model/OrdersV0/OrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,16 @@ class OrderItem extends BaseModel implements ModelInterface, ArrayAccess, \JsonS

const DEEMED_RESELLER_CATEGORY_IOSS = 'IOSS';
const DEEMED_RESELLER_CATEGORY_UOSS = 'UOSS';
const DEEMED_RESELLER_CATEGORY_SG_VOEC = 'SG_VOEC';
const DEEMED_RESELLER_CATEGORY_GB_VOEC = 'GB_VOEC';
const DEEMED_RESELLER_CATEGORY_NO_VOEC = 'NO_VOEC';
const DEEMED_RESELLER_CATEGORY_CA_MPF = 'CA_MPF';
const DEEMED_RESELLER_CATEGORY_AU_VOEC = 'AU_VOEC';
const DEEMED_RESELLER_CATEGORY_NZ_VOEC = 'NZ_VOEC';
const DEEMED_RESELLER_CATEGORY_GB_VOEC = 'GB_VOEC';
const DEEMED_RESELLER_CATEGORY_JE_VOEC = 'JE_VOEC';
const DEEMED_RESELLER_CATEGORY_KZ_VOEC = 'KZ_VOEC';
const DEEMED_RESELLER_CATEGORY_MY_VOEC = 'MY_VOEC';
const DEEMED_RESELLER_CATEGORY_NO_VOEC = 'NO_VOEC';
const DEEMED_RESELLER_CATEGORY_NG_VOEC = 'NG_VOEC';
const DEEMED_RESELLER_CATEGORY_NZ_VOEC = 'NZ_VOEC';
const DEEMED_RESELLER_CATEGORY_SG_VOEC = 'SG_VOEC';
const DEEMED_RESELLER_CATEGORY_CH_SUPPLIER_IMPORT = 'CH_SUPPLIER_IMPORT';


Expand All @@ -297,13 +300,16 @@ public function getDeemedResellerCategoryAllowableValues()
$baseVals = [
self::DEEMED_RESELLER_CATEGORY_IOSS,
self::DEEMED_RESELLER_CATEGORY_UOSS,
self::DEEMED_RESELLER_CATEGORY_SG_VOEC,
self::DEEMED_RESELLER_CATEGORY_AU_VOEC,
self::DEEMED_RESELLER_CATEGORY_CA_MPF,
self::DEEMED_RESELLER_CATEGORY_GB_VOEC,
self::DEEMED_RESELLER_CATEGORY_JE_VOEC,
self::DEEMED_RESELLER_CATEGORY_KZ_VOEC,
self::DEEMED_RESELLER_CATEGORY_MY_VOEC,
self::DEEMED_RESELLER_CATEGORY_NO_VOEC,
self::DEEMED_RESELLER_CATEGORY_CA_MPF,
self::DEEMED_RESELLER_CATEGORY_AU_VOEC,
self::DEEMED_RESELLER_CATEGORY_NG_VOEC,
self::DEEMED_RESELLER_CATEGORY_NZ_VOEC,
self::DEEMED_RESELLER_CATEGORY_JE_VOEC,
self::DEEMED_RESELLER_CATEGORY_SG_VOEC,
self::DEEMED_RESELLER_CATEGORY_CH_SUPPLIER_IMPORT,
];

Expand Down
3 changes: 3 additions & 0 deletions lib/Model/OrdersV0/TaxCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ public function getResponsibleParty()
*/
public function setResponsibleParty($responsible_party)
{
if (empty($responsible_party)) {
$responsible_party = null;
}
$allowedValues = $this->getResponsiblePartyAllowableValues();
if (!is_null($responsible_party) &&!in_array(strtoupper($responsible_party), $allowedValues, true)) {
throw new \InvalidArgumentException(
Expand Down

0 comments on commit 1ae7a24

Please sign in to comment.