Skip to content

Commit

Permalink
Merge pull request #5 from thebiggive/auth-update
Browse files Browse the repository at this point in the history
Narrow permitted auth to 'clear' in line with latest specs
  • Loading branch information
Noel Light-Hilary authored Sep 21, 2021
2 parents 06bf8cc + cf49aca commit 72423d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/GovTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,8 @@ public function getSenderEmailAddress()

/**
* Sets the type of authentication to use for with the message. The message
* type must be one of 'alternative', 'clear', 'MD5' or 'W3Csigned'. Other
* values will not be set and will return false.
* type must now be 'clear'. Other values will not be set and will return false.
* HMRC docs as of 2021 suggest that at least the MD5 type has been retired.
*
* @param string $messageAuthType The type of authentication to set.
* @return boolean True if the authentication type is valid and set, false if it's invalid (and therefore not set).
Expand All @@ -781,8 +781,6 @@ public function setMessageAuthentication($messageAuthType)
switch ($messageAuthType) {
case 'alternative':
case 'clear':
case 'MD5':
case 'W3Csigned':
$this->messageAuthType = $messageAuthType;
return true;
break;
Expand Down Expand Up @@ -1174,6 +1172,8 @@ public function sendMessage($cRequestString = null): bool
}
}
if ($validXMLResponse === true) {
// TODO props suppress warnings and bubble errors through in a more helpful way.
// Return false when there are major parse errors.
$this->fullResponseObject = simplexml_load_string($gatewayResponse);
}
return true;
Expand Down

0 comments on commit 72423d9

Please sign in to comment.