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

Invalid value '' for 'responsible_party', must be one of 'AMAZON SERVICES, INC.', 'AMAZON COMMERCIAL SERVICES PTY LTD' #813

Open
zero-to-prod opened this issue Nov 8, 2024 · 6 comments

Comments

@zero-to-prod
Copy link

Problem description:

Error when setting the responsible party.

On a response from Amazon, they pass an empty string as the responsible party.
Because an empty string is not an allowable value for a party name, the an exception is thrown.

Please make an empty string not error for the responsible party.

Error:

Invalid value '' for 'responsible_party', must be one of 'AMAZON SERVICES, INC.', 'AMAZON COMMERCIAL SERVICES PTY LTD'

Code

selling-partner-api/lib/Model/OrdersV0/TaxCollection.php:265

    public function setResponsibleParty($responsible_party)
    {
        $allowedValues = $this->getResponsiblePartyAllowableValues();
        if (!empty($responsible_party) && !is_null($responsible_party) &&!in_array(strtoupper($responsible_party), $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'responsible_party', must be one of '%s'",
                    $responsible_party,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['responsible_party'] = $responsible_party;

        return $this;
    }
@jlevers
Copy link
Owner

jlevers commented Nov 8, 2024

Are you on the latest v5 release, 5.10.3? We just pushed a new release yesterday that (I think) fixed this issue.

@zero-to-prod
Copy link
Author

zero-to-prod commented Nov 11, 2024

It looks like roave/security-advisories is blocking phpoffice/phpspreadsheet[1.25.2] from upgrading to 5.10.3.

  Problem 1
    - Root composer.json requires jlevers/selling-partner-api ^5.10.3 -> satisfiable by jlevers/selling-partner-api[5.10.3].
    - Root composer.json requires roave/security-advisories dev-latest -> satisfiable by roave/security-advisories[dev-latest].
    - jlevers/selling-partner-api 5.10.3 requires phpoffice/phpspreadsheet 1.25.2 -> satisfiable by phpoffice/phpspreadsheet[1.25.2].
    - roave/security-advisories dev-latest conflicts with phpoffice/phpspreadsheet 1.25.2.

You will have to bump the version of phpoffice/phpspreadsheet or remove it. :(

This is blocking everyone who has roave/security-advisories from upgrading.

That package has some nasty vulnerabilities: https://github.com/PHPOffice/PhpSpreadsheet/security/advisories

I appreciate your efforts on this.
It seems like this package can be a pita at times.

@iajrz
Copy link
Collaborator

iajrz commented Nov 11, 2024

Unfortunately the next phpoffice/phpspreadsheet version is 1.26.0, which breaks compatibility with php 7.3; furthermore, it's an indirect dependency.

This is also a distinct issue from the original one; I think it deserves a specific issue, at the very least for visibility: this change would leave people who need php 7.3 stranded.

I notice that php v7.3 is already EOL'd, so this is old enough that I don't feel completely uncomfortable dropping support for that version.

Would you be kind enough to open a PR updating this package and updating the required php version to something more recent?

Just removing the library version fix should be enough to get the package going, but testing it out and determining the php version required is a little bit more legwork.

@jlevers
Copy link
Owner

jlevers commented Nov 11, 2024

Also, FWIW, if you upgrade to v7 this set of problems will go away entirely.

@liangcan888
Copy link

I have the same problem, I am using version V5.10.3. If it is solved, can you tell me how to solve it?

@liangcan888
Copy link

Also, FWIW, if you upgrade to v7 this set of problems will go away entirely.

If it is V5.10.3, how to solve it? My PHP version cannot be upgraded to PHP8.0 or above for the time being. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants