Handle encrypted credit card details where supplied #9 #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Eway already supports encryptedCardNumber as a paramter. However, that relies on the calling
code 'knowing' whether the card has been encrypted - which would not happen if a script blocker was
in play and is hard for the calling code to adapt to generically.
However, at this point in the code we know that if it is following the eway format for being encrypted
then it has been encrypted. I would note that it is supported by the Request object
not the credit card class but
a) that is already the case, this just makes it a bit simpler to use and
b) the encryptedCardNumber does not hold sensitive data in the same way that the 'card'
parameters do.
The upstream plan appears to be to have another class to handle this - in which case this bit of handling code
and the code that interacts with it could be updated later to reflect that