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

Wrong parameter type in metadata functions #652

Closed
GunniBusch opened this issue Apr 30, 2024 · 3 comments
Closed

Wrong parameter type in metadata functions #652

GunniBusch opened this issue Apr 30, 2024 · 3 comments
Labels

Comments

@GunniBusch
Copy link

In this function, the parameter type also includes null. but it should not be null.

Could there be just no action if it is null?

    /**
     * Sets metadata
     *
     * @param array<string,string>|null $metadata Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request. * Maximum 20 characters per key. * Maximum 80 characters per value.
     *
     * @return self
     */
    public function setMetadata($metadata)
    {
        if (is_null($metadata)) {
            throw new \InvalidArgumentException('non-nullable metadata cannot be null');
        }
        $this->container['metadata'] = $metadata;

        return $this;
    }

PS: it is in all setMetadata functions.

@GunniBusch GunniBusch changed the title Wrong parameter type in metadata function of Checkout Wrong parameter type in metadata functions Apr 30, 2024
@jillingk
Copy link
Contributor

jillingk commented Jul 4, 2024

Hi @GunniBusch,

We've just merged a fix that removes the null check. We realised that the serialiser will omit these during serialisation anyways so we simply use null values to remove fields on the setter. This means null is allowed as means to remove pre-filled fields. Hope that makes sense and answers your question.

Best, Jilling
Adyen

Copy link

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 19, 2024
Copy link

This issue was closed due to inactivity. Please reopen if you still encounter this problem or have more information to add.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants