Skip to content

Conversation

@meden
Copy link
Contributor

@meden meden commented Jun 20, 2019

Using the Adyen plugin we had an unexpected behavior with the address validation. It turned out that the plugin was silently changing the data just to pass the validation in one specific use case.
Moreover, the criteria used to determine if the billing address should whether be sent or not were not compliant with the Adyen documentation.
This pull request should address both issues.

I'm not sure of the impact on backward compatibility, but IMHO relying on plugin's opaque behavior to get things done is not a good idea (e.g. it costed us some time to figure out what was happening).

meden added 2 commits June 20, 2019 11:03
A setter should not change a field value just to avoid validation issues:
if data are invalid, they should be explicitely fixed in the data source.
As per Adyen documentation, the billing address per se is optional [1],
but when sending it, the country is always mandatory, while the
remaining fields must either be sent all or none [2] (although in our
experience the ZIP always has been treated as optional by Adyen: maybe
it is mandatory only for US and CA).

This commit makes the address validation compliant (altough still only
validates the data presence, not the *values* formal correctness).

[1] https://docs.adyen.com/api-reference/payments-api/paymentrequest/
[2] https://docs.adyen.com/api-reference/common-api/address/
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

Successfully merging this pull request may close these issues.

1 participant