IABTechLab / iabgpp-java

Apache License 2.0
11 stars 12 forks source link

Conditionally skip MSPA validation #49

Closed ym-corey closed 2 months ago

ym-corey commented 2 months ago

Only run validation against mspaServiceProviderMode when mspaCoveredTransaction is a value other than 2 (NO). Currently validation will require certain variables to be set/validated but they may not be applicable in certain contexts.

patmmccann commented 2 months ago

This seems wrong to me, you shouldn't skip them, if they are set to invalid values on a noncovered transaction the whole string is invalid

ym-corey commented 2 months ago

Hm, ok. I see your point.

I was thinking that some CMPs are likely to take short cuts in generation of these strings believing that invalidating a section by marking it as not applicable implies a short-circuiting to the content within that section. I found it surprising that during my testing (test writing), indicating a particular instance was not an mspaCoveredTransaction, the instance was invalid with the default value generated.

Maybe this will be a non-issue in practice.

patmmccann commented 2 months ago

Makes sense, but invalid is invalid; I don't like figuring out the line of 'this is probably what they really meant'

ym-corey commented 2 months ago

I'm okay with that. Thanks for your explanation and reasoning. I'll close out this PR.