From 3e01530c6dcf614e377f46d86db5f64c19082d51 Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 17:33:44 +0100 Subject: [PATCH 1/7] =?UTF-8?q?CLA-25=20=E2=80=93=20set=20up=20Agents'=20c?= =?UTF-8?q?laims=20so=20payment=20is=20directly=20to=20charities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GiftAid.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/GiftAid.php b/src/GiftAid.php index 326fbb2..c89c16f 100644 --- a/src/GiftAid.php +++ b/src/GiftAid.php @@ -761,11 +761,24 @@ public function giftAidSubmit($donor_data) $package->startElement('R68'); if ($this->isAgentMultiClaim()) { - $package->startElement('CollAgent'); - $package->writeElement('AgentNo', $this->agentDetails['number']); + $package->startElement('AgtOrNom'); + $package->writeElement('OrgName', $this->agentDetails['company']); + $package->writeElement('RefNo', $this->agentDetails['number']); $claimNo = $this->agentDetails['reference'] ?? uniqid(); $package->writeElement('ClaimNo', $claimNo); - $package->endElement(); // CollAgent + $package->writeElement('PayToAoN', 'no'); // Pay to charity. + + $package->startElement('AoNID'); + if (empty($this->agentDetails['address']['postcode'])) { + $package->writeElement('Overseas', 'yes'); + } else { + $package->writeElement('Postcode', $this->agentDetails['address']['postcode']); + } + $package->endElement(); // AoNID + + $package->writeElement('Phone', $this->agentDetails['contact']['telephone']); + + $package->endElement(); // AgtOrNom } else { $package->startElement('AuthOfficial'); $package->startElement('OffName'); From f0e31c54d9dba42c732f8c1bebd4c919ed922da6 Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 17:41:19 +0100 Subject: [PATCH 2/7] =?UTF-8?q?CLA-25=20=E2=80=93=20update=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `telephone` for Agents is no longer optional --- tests/GovTalk/GiftAid/GiftAidTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/GovTalk/GiftAid/GiftAidTest.php b/tests/GovTalk/GiftAid/GiftAidTest.php index e33692f..bfaea45 100644 --- a/tests/GovTalk/GiftAid/GiftAidTest.php +++ b/tests/GovTalk/GiftAid/GiftAidTest.php @@ -663,6 +663,7 @@ private function addValidTestAgent(GiftAid $giftAidService, bool $withOptionalFi 'surname' => 'Bravo', ], 'email' => 'billie@example.org', + 'telephone' => '01111 111112', ]; $agentAddress = [ @@ -674,8 +675,6 @@ private function addValidTestAgent(GiftAid $giftAidService, bool $withOptionalFi if ($withOptionalFields) { $agentContact['fax'] = '01111 111111'; - $agentContact['telephone'] = '01111 111112'; - $agentAddress['postcode'] = 'N1 1AA'; } From 8b05568ceac779576607ee0b233af4b75693593a Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 18:01:39 +0100 Subject: [PATCH 3/7] =?UTF-8?q?CLA-25=20=E2=80=93=20fix=20invalid=20`PayTo?= =?UTF-8?q?AoN`=20"no"=20element?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GiftAid.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GiftAid.php b/src/GiftAid.php index c89c16f..3ea3a5f 100644 --- a/src/GiftAid.php +++ b/src/GiftAid.php @@ -766,7 +766,8 @@ public function giftAidSubmit($donor_data) $package->writeElement('RefNo', $this->agentDetails['number']); $claimNo = $this->agentDetails['reference'] ?? uniqid(); $package->writeElement('ClaimNo', $claimNo); - $package->writeElement('PayToAoN', 'no'); // Pay to charity. + + // Note we never set `PayToAoN`. => HMRC always pay to the charity direct. $package->startElement('AoNID'); if (empty($this->agentDetails['address']['postcode'])) { From 08c5a533ba2d91f96dc99f890e1b61461165e142 Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 18:13:58 +0100 Subject: [PATCH 4/7] =?UTF-8?q?CLA-25=20=E2=80=93=20fix=20invalid=20`Agent?= =?UTF-8?q?.Contact`=20element=20being=20written=20when=20just=20agent=20`?= =?UTF-8?q?telephone`=20supplied?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GiftAid.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/GiftAid.php b/src/GiftAid.php index 3ea3a5f..952b8a7 100644 --- a/src/GiftAid.php +++ b/src/GiftAid.php @@ -467,6 +467,10 @@ public function getGasdsAdjustment() * @param string $company The agent company's name. * @param array $address The agent company's address in the format specified above. * @param ?array $contact The agent company's key contact (optional, may be skipped with a null value). + * If `['name']['surname']` is empty or not set, the whole name will be skipepd. + * This is done to enable just 'telephone' to be provided for claims where an + * `AgtOrNom` element is to be set up with an organisation name and the required + * phone number, but not other personal Agent information. * @param ?string $reference An identifier for the agent's own reference (optional). * @return bool Whether company format was as expected & agent data was set. */ @@ -717,7 +721,7 @@ public function giftAidSubmit($donor_data) $package->writeElement('Country', $this->agentDetails['address']['country']); $package->endElement(); // Address - if (isset($this->agentDetails['contact'])) { + if (isset($this->agentDetails['contact']) && !empty($this->agentDetails['contact']['name']['surname'])) { $package->startElement('Contact'); $package->startElement('Name'); From 559192ca9c6984f16da188e5bf22290217d0709f Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 18:28:38 +0100 Subject: [PATCH 5/7] =?UTF-8?q?CLA-25=20=E2=80=93=20fix=20Agent/Nominee=20?= =?UTF-8?q?logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GiftAid.php | 119 ++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 64 deletions(-) diff --git a/src/GiftAid.php b/src/GiftAid.php index 952b8a7..96d17ae 100644 --- a/src/GiftAid.php +++ b/src/GiftAid.php @@ -37,7 +37,6 @@ class GiftAid extends GovTalk private string $vendorId = ''; private static string $singleClaimMessageClass = 'HMRC-CHAR-CLM'; - private static string $multiClaimMessageClass = 'HMRC-CHAR-CLM-MULTI'; /** * URI for product submitting the claim @@ -526,8 +525,8 @@ public function setAgentDetails( * 'aggregation' => (?string) Description of aggregated donations up to 35 * characters, if applicable * 'amount' => (float) In whole pounds GBP - * 'org_name' => (?string) Required for Agent multi-charity claims. Ignored for others. - * 'org_hmrc_ref' => (?string) Required for Agent multi-charity claims. Ignored for others. + * 'org_name' => (?string) Required for Agent/Nominee [not Collection Agent] claims. Ignored for others. + * 'org_hmrc_ref' => (?string) Required for Agent/Nominee [not Collection Agent] claims. Ignored for others. * ] * @return string */ @@ -543,10 +542,10 @@ private function buildClaimXml(array $donations): string $earliestDate = strtotime(date('Y-m-d')); foreach ($donations as $index => $d) { - if ($this->isAgentMultiClaim()) { + if ($this->isAgentClaim()) { if (empty($d['org_hmrc_ref'])) { $this->logger->warning(sprintf( - 'Skipping donation index %d (%s %s) with no org ref in agent multi mode', + 'Skipping donation index %d (%s %s) with no org ref in agent mode', $index, $d['first_name'], $d['last_name'], @@ -657,7 +656,7 @@ public function giftAidSubmit($donor_data) } // It seems like only single org / direct claims use/need the Authorised Official. - if (!$this->isAgentMultiClaim() && $this->getAuthorisedOfficial() === null) { + if (!$this->isAgentClaim() && $this->getAuthorisedOfficial() === null) { $this->logger->error('Cannot proceed without authorisedOfficial'); return false; } @@ -668,7 +667,7 @@ public function giftAidSubmit($donor_data) $cOrganisation = 'IR'; $sDefaultCurrency = 'GBP'; // currently HMRC only allows GBP $sIRmark = 'IRmark+Token'; - $sSender = $this->isAgentMultiClaim() ? 'Agent' : 'Individual'; + $sSender = $this->isAgentClaim() ? 'Agent' : 'Individual'; // Set the message envelope $this->setMessageClass($this->getMessageClass()); @@ -703,7 +702,7 @@ public function giftAidSubmit($donor_data) $package->endElement(); # Keys $package->writeElement('PeriodEnd', $dReturnPeriod); - if ($this->isAgentMultiClaim()) { + if ($this->isAgentClaim()) { $package->startElement('Agent'); $package->writeElement('Company', $this->agentDetails['company']); @@ -764,7 +763,7 @@ public function giftAidSubmit($donor_data) $package->startElement('R68'); - if ($this->isAgentMultiClaim()) { + if ($this->isAgentClaim()) { $package->startElement('AgtOrNom'); $package->writeElement('OrgName', $this->agentDetails['company']); $package->writeElement('RefNo', $this->agentDetails['number']); @@ -996,7 +995,7 @@ protected function packageDigest($package) return $package; } - protected function isAgentMultiClaim(): bool + protected function isAgentClaim(): bool { return !empty($this->agentDetails); } @@ -1006,7 +1005,7 @@ protected function isAgentMultiClaim(): bool */ protected function getMessageClass(): string { - return $this->isAgentMultiClaim() ? static::$multiClaimMessageClass : static::$singleClaimMessageClass; + return static::$singleClaimMessageClass; } /** @@ -1014,12 +1013,12 @@ protected function getMessageClass(): string */ protected function getCharIdKey(): string { - return $this->isAgentMultiClaim() ? 'AGENTCHARID' : 'CHARID'; + return 'CHARID'; } protected function getCharIdValue(): string { - return $this->isAgentMultiClaim() + return $this->isAgentClaim() ? $this->agentDetails['number'] : $this->getClaimingOrganisation()->getHmrcRef(); } @@ -1030,21 +1029,17 @@ protected function writeClaimStartData(XMLWriter $package, ClaimingOrganisation $package->writeElement('OrgName', $org->getName()); $package->writeElement('HMRCref', $org->getHmrcRef()); - // LTS response code 7032: "Regulator details must not be present if - // Collecting Agent details are present" - if (!$this->isAgentMultiClaim()) { - $package->startElement('Regulator'); + $package->startElement('Regulator'); - if ($org->getRegulator() === null) { - $package->writeElement('NoReg', 'yes'); - } elseif ($org->hasStandardRegulator()) { - $package->writeElement('RegName', $org->getRegulator()); - } else { - $package->writeElement('OtherReg', $org->getRegulator()); - } - $package->writeElement('RegNo', $org->getRegNo()); - $package->endElement(); # Regulator + if ($org->getRegulator() === null) { + $package->writeElement('NoReg', 'yes'); + } elseif ($org->hasStandardRegulator()) { + $package->writeElement('RegName', $org->getRegulator()); + } else { + $package->writeElement('OtherReg', $org->getRegulator()); } + $package->writeElement('RegNo', $org->getRegNo()); + $package->endElement(); # Regulator $package->startElement('Repayment'); } @@ -1058,49 +1053,45 @@ protected function writeClaimEndData(XMLWriter $package, $earliestDate): void } $package->endElement(); # Repayment - // LTS response code 7044: "A submission from a Collecting Agent must not include - // details of Gift Aid Small Donations Schemes" - if (!$this->isAgentMultiClaim()) { - $package->startElement('GASDS'); - $package->writeElement( - 'ConnectedCharities', - $this->getClaimingOrganisation()->getHasConnectedCharities() ? 'yes' : 'no' - ); - foreach ($this->getClaimingOrganisation()->getConnectedCharities() as $cc) { - $package->startElement('Charity'); - $package->writeElement('Name', $cc->getName()); - $package->writeElement('HMRCref', $cc->getHmrcRef()); - $package->endElement(); # Charity - } - if ($this->haveGasds()) { - foreach ($this->gasdsYear as $key => $val) { - $package->startElement('GASDSClaim'); - $package->writeElement('Year', $this->gasdsYear[$key]); - $package->writeElement('Amount', number_format($this->gasdsAmount[$key], 2, '.', '')); - $package->endElement(); # GASDSClaim - } - } - - $package->writeElement('CommBldgs', ($this->haveCbcd == true) ? 'yes' : 'no'); - foreach ($this->cbcdAddr as $key => $val) { - $package->startElement('Building'); - $package->writeElement('BldgName', $this->cbcdBldg[$key]); - $package->writeElement('Address', $this->cbcdAddr[$key]); - $package->writeElement('Postcode', $this->cbcdPoCo[$key]); - $package->startElement('BldgClaim'); - $package->writeElement('Year', $this->cbcdYear[$key]); - $package->writeElement('Amount', number_format($this->cbcdAmount[$key], 2, '.', '')); - $package->endElement(); # BldgClaim - $package->endElement(); # Building + $package->startElement('GASDS'); + $package->writeElement( + 'ConnectedCharities', + $this->getClaimingOrganisation()->getHasConnectedCharities() ? 'yes' : 'no' + ); + foreach ($this->getClaimingOrganisation()->getConnectedCharities() as $cc) { + $package->startElement('Charity'); + $package->writeElement('Name', $cc->getName()); + $package->writeElement('HMRCref', $cc->getHmrcRef()); + $package->endElement(); # Charity + } + if ($this->haveGasds()) { + foreach ($this->gasdsYear as $key => $val) { + $package->startElement('GASDSClaim'); + $package->writeElement('Year', $this->gasdsYear[$key]); + $package->writeElement('Amount', number_format($this->gasdsAmount[$key], 2, '.', '')); + $package->endElement(); # GASDSClaim } + } - if (!empty($this->gasdsAdjustment)) { - $package->writeElement('Adj', number_format($this->gasdsAdjustment, 2, '.', '')); - } + $package->writeElement('CommBldgs', ($this->haveCbcd == true) ? 'yes' : 'no'); + foreach ($this->cbcdAddr as $key => $val) { + $package->startElement('Building'); + $package->writeElement('BldgName', $this->cbcdBldg[$key]); + $package->writeElement('Address', $this->cbcdAddr[$key]); + $package->writeElement('Postcode', $this->cbcdPoCo[$key]); + $package->startElement('BldgClaim'); + $package->writeElement('Year', $this->cbcdYear[$key]); + $package->writeElement('Amount', number_format($this->cbcdAmount[$key], 2, '.', '')); + $package->endElement(); # BldgClaim + $package->endElement(); # Building + } - $package->endElement(); # GASDS + if (!empty($this->gasdsAdjustment)) { + $package->writeElement('Adj', number_format($this->gasdsAdjustment, 2, '.', '')); } + $package->endElement(); # GASDS + $otherInfo = []; if (!empty($this->gasdsAdjustment)) { $otherInfo[] = $this->gasdsAdjReason; From 76d96e351a60ba1104892c310d677fa6f601221b Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 18:34:55 +0100 Subject: [PATCH 6/7] =?UTF-8?q?CLA-25=20=E2=80=93=20update=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/GovTalk/GiftAid/GiftAidTest.php | 20 +++++++++---------- .../GiftAid/Mock/ClaimResponsePoll.xml | 1 + .../GiftAid/Mock/MultiClaimResponsePoll.xml | 1 - .../GiftAid/Mock/SubmitMultiAckResponse.xml | 1 - .../Mock/SubmitMultiMissingNamesResponse.xml | 1 - .../SubmitMultiMultipleErrorsResponse.xml | 1 - .../Mock/SubmitNomineeClaimAckResponse.xml | 1 + ...SubmitNomineeClaimMissingNamesResponse.xml | 1 + ...bmitNomineeClaimMultipleErrorsResponse.xml | 1 + 9 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 tests/GovTalk/GiftAid/Mock/ClaimResponsePoll.xml delete mode 100644 tests/GovTalk/GiftAid/Mock/MultiClaimResponsePoll.xml delete mode 100644 tests/GovTalk/GiftAid/Mock/SubmitMultiAckResponse.xml delete mode 100644 tests/GovTalk/GiftAid/Mock/SubmitMultiMissingNamesResponse.xml delete mode 100644 tests/GovTalk/GiftAid/Mock/SubmitMultiMultipleErrorsResponse.xml create mode 100644 tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimAckResponse.xml create mode 100644 tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMissingNamesResponse.xml create mode 100644 tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMultipleErrorsResponse.xml diff --git a/tests/GovTalk/GiftAid/GiftAidTest.php b/tests/GovTalk/GiftAid/GiftAidTest.php index bfaea45..bc90846 100644 --- a/tests/GovTalk/GiftAid/GiftAidTest.php +++ b/tests/GovTalk/GiftAid/GiftAidTest.php @@ -401,9 +401,9 @@ public function testClaimWithCommunityBuildingsSubmissionAck(): void $this->assertSame('A19FA1A31BCB42D887EA323292AACD88', $response['correlationid']); } - public function testMultiClaimSubmissionAck(): void + public function testNomineeClaimSubmissionAck(): void { - $this->setMockHttpResponse('SubmitMultiAckResponse.xml'); + $this->setMockHttpResponse('SubmitNomineeClaimAckResponse.xml'); $this->gaService = $this->setUpService(); // Use client w/ mock queue. $this->gaService->setAuthorisedOfficial($this->officer); @@ -428,9 +428,9 @@ public function testMultiClaimSubmissionAck(): void $this->assertSame('9072983591062099772', $response['correlationid']); } - public function testMultiClaimSubmissionAckWithOfficialAndAgentOptionalFields(): void + public function testNomineeClaimSubmissionAckWithOfficialAndAgentOptionalFields(): void { - $this->setMockHttpResponse('SubmitMultiAckResponse.xml'); + $this->setMockHttpResponse('SubmitNomineeClaimAckResponse.xml'); $this->gaService = $this->setUpService(); // Use client w/ mock queue. $this->officer->setTitle('Mx'); @@ -457,9 +457,9 @@ public function testMultiClaimSubmissionAckWithOfficialAndAgentOptionalFields(): $this->assertSame('9072983591062099772', $response['correlationid']); } - public function testMultiClaimSubmissionWithFirstDonationNamesMissing(): void + public function testNomineeClaimSubmissionWithFirstDonationNamesMissing(): void { - $this->setMockHttpResponse('SubmitMultiMissingNamesResponse.xml'); + $this->setMockHttpResponse('SubmitNomineeClaimMissingNamesResponse.xml'); $this->gaService = $this->setUpService(); // Use client w/ mock queue. // Provide identifier to trace donation errors, and give the 0th donation one by clearing @@ -510,11 +510,11 @@ public function testMultiClaimSubmissionWithFirstDonationNamesMissing(): void $this->assertEquals(['some-uuid-1234'], $response['donation_ids_with_errors']); } - public function testMultiClaimSubmissionWithMultipleDonationErrors(): void + public function testNomineeClaimSubmissionWithMultipleDonationErrors(): void { // We separately test this to be confident the correct errors map back // to the correct donation IDs. - $this->setMockHttpResponse('SubmitMultiMultipleErrorsResponse.xml'); + $this->setMockHttpResponse('SubmitNomineeClaimMultipleErrorsResponse.xml'); $this->gaService = $this->setUpService(); // Use client w/ mock queue. // Provide identifier to trace donation errors, and give the 0th donation one by clearing @@ -588,9 +588,9 @@ public function testDeclarationResponsePoll(): void $this->assertSame('A19FA1A31BCB42D887EA323292AACD88', $response['correlationid']); } - public function testMultiClaimPollSuccessAndResponseDataFormat(): void + public function testPollSuccessAndResponseDataFormat(): void { - $this->setMockHttpResponse('MultiClaimResponsePoll.xml'); + $this->setMockHttpResponse('ClaimResponsePoll.xml'); $this->gaService = $this->setUpService(); // Use client w/ mock queue. $response = $this->gaService->declarationResponsePoll( diff --git a/tests/GovTalk/GiftAid/Mock/ClaimResponsePoll.xml b/tests/GovTalk/GiftAid/Mock/ClaimResponsePoll.xml new file mode 100644 index 0000000..9e7b7dc --- /dev/null +++ b/tests/GovTalk/GiftAid/Mock/ClaimResponsePoll.xml @@ -0,0 +1 @@ +2.0
HMRC-CHAR-CLMresponsesubmit123456https://secure.dev.gateway.gov.uk/pollXML2022-04-04T14:56:57.187
(count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body)=count(ancestor-or-self::node())) and (count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body/*[name()='IRenvelope']/*[name()='IRheader']/*[name()='IRmark'])!=count(ancestor-or-self::node()))someDigestsomeSig==someCert=HMRC has received the HMRC-CHAR-CLM document ref: 92100000000000 at 08.53 on 04/04/2022. The associated IRmark was: 7QAAAAA000000AAAAAAAAA. We strongly recommend that you keep this receipt electronically, and we advise that you also keep your submission electronically for your records. They are evidence of the information that you submitted to HMRC.Thank you for your submission2022-04-04T08:53:35.179
diff --git a/tests/GovTalk/GiftAid/Mock/MultiClaimResponsePoll.xml b/tests/GovTalk/GiftAid/Mock/MultiClaimResponsePoll.xml deleted file mode 100644 index 41daa51..0000000 --- a/tests/GovTalk/GiftAid/Mock/MultiClaimResponsePoll.xml +++ /dev/null @@ -1 +0,0 @@ -2.0
HMRC-CHAR-CLM-MULTIresponsesubmit123456https://secure.dev.gateway.gov.uk/pollXML2022-04-04T14:56:57.187
(count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body)=count(ancestor-or-self::node())) and (count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body/*[name()='IRenvelope']/*[name()='IRheader']/*[name()='IRmark'])!=count(ancestor-or-self::node()))someDigestsomeSig==someCert=HMRC has received the HMRC-CHAR-CLM-MULTI document ref: 92100000000000 at 08.53 on 04/04/2022. The associated IRmark was: 7QAAAAA000000AAAAAAAAA. We strongly recommend that you keep this receipt electronically, and we advise that you also keep your submission electronically for your records. They are evidence of the information that you submitted to HMRC.Thank you for your submission2022-04-04T08:53:35.179
diff --git a/tests/GovTalk/GiftAid/Mock/SubmitMultiAckResponse.xml b/tests/GovTalk/GiftAid/Mock/SubmitMultiAckResponse.xml deleted file mode 100644 index 959a830..0000000 --- a/tests/GovTalk/GiftAid/Mock/SubmitMultiAckResponse.xml +++ /dev/null @@ -1 +0,0 @@ - 2.0
HMRC-CHAR-CLM-MULTI response submit 9072983591062099772 http://localhost:5665/LTS/LTSServlet XML 2021-10-08T11:24:58.024
(count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body)=count(ancestor-or-self::node())) and (count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body/*[name()='IRenvelope']/*[name()='IRheader']/*[name()='IRmark'])!=count(ancestor-or-self::node())) yPwKM0owwwzn3saHOT4rj02rqU0= ov+vziKsXzCpAHOZskSSp5yJptHB+fFilM8iaV3Agy7W9/xyqQfj98+uiOBqP73mwUzmZ9dyF7OQXIg75X/AgwNUHKGvId7i+L+XxlvCDoPm1QwBX+wliaCLXEXC9u2QHTDjz+8sUjyogZDlHJJdvfgEnhrX9kT4Ge9C4TAQRtQ= MIIDKTCCApKgAwIBAgIBAjANBgkqhkiG9w0BAQQFADB1MQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxGTAXBgNVBAcTEE9ha2Jyb29rIFRlcnJhY2UxEDAOBgNVBAoTB1NhcnZlZ2ExEDAOBgNVBAsTB1N1cHBvcnQxFDASBgNVBAMTC1NhcnZlZ2FEZW1vMB4XDTA0MTAwNzE2MDYwOFoXDTI5MTAwMTE2MDYwOFoweTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCElsbGlub2lzMRkwFwYDVQQHExBPYWticm9vayBUZXJyYWNlMRAwDgYDVQQKEwdTYXJ2ZWdhMRAwDgYDVQQLEwdTdXBwb3J0MRgwFgYDVQQDEw9TYXJ2ZWdhRGVtb0NlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOuak58DVFSXNRJzyvthjWYBn+yQX67cemqa1ZVF460RuwOCODZJHP8KlLnrJyZHVuBzlA0yHGKz5ABjpj/N7/IWxrC4LEH0Tuw1WCqaDTaSV2AtyEs7fgtopit6KM/yMGwqrDSHcuMi++yr5ynhfOS5uWZ9dSYwwmCtLmEauayfAgMBAAGjgcQwgcEwHQYDVR0OBBYEFH5QwQCCP0EqP0vwyRifonAT46ooMIGfBgNVHSMEgZcwgZSAFGU/dbDLz6UwZVm9DPwTghnj4tt6oXmkdzB1MQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxGTAXBgNVBAcTEE9ha2Jyb29rIFRlcnJhY2UxEDAOBgNVBAoTB1NhcnZlZ2ExEDAOBgNVBAsTB1N1cHBvcnQxFDASBgNVBAMTC1NhcnZlZ2FEZW1vggEAMA0GCSqGSIb3DQEBBAUAA4GBAJ7UjONH53zehnwbxNmLsr2FtdDSkQL9JFPEctPrjThu8w+4m/C8u+spUnIdPr9P3f5870L3/+EcePsXAc00xx4uqsrCkCD2unpKO7ZO0fqmvd2dMQqpcQv5Lm7jQa1HpmRcNwGiQhslp0K+oCxds2w4jZWt7W/l/H0Htg6kRnzD HMRC has received the HMRC-CHAR-CLM-MULTI document ref: 92100000495393 at 11.24 on 08/10/2021. The associated IRmark was: ZD6AUM2KGDBQZZ66Y2DTSPRLR5G2XKKN. We strongly recommend that you keep this receipt electronically, and we advise that you also keep your submission electronically for your records. They are evidence of the information that you submitted to HMRC. Thank you for your submission 2021-10-08T11:24:58.024
diff --git a/tests/GovTalk/GiftAid/Mock/SubmitMultiMissingNamesResponse.xml b/tests/GovTalk/GiftAid/Mock/SubmitMultiMissingNamesResponse.xml deleted file mode 100644 index 0a8c825..0000000 --- a/tests/GovTalk/GiftAid/Mock/SubmitMultiMissingNamesResponse.xml +++ /dev/null @@ -1 +0,0 @@ - 2.0
HMRC-CHAR-CLM-MULTI error submit 986769003220431383 http://localhost:5665/LTS/LTSServlet XML 2021-10-08T11:29:02.029
ChRIS 3001 business Your submission failed due to business validation errors. Please see below for details. 4 ChRIS 4065 schema Invalid content found at element 'Sur' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-type.3.1.3: The value '' of element 'Sur' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_SurDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Fore' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-type.3.1.3: The value '' of element 'Fore' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ForeDonorGADRepaymentClaimR68'.
diff --git a/tests/GovTalk/GiftAid/Mock/SubmitMultiMultipleErrorsResponse.xml b/tests/GovTalk/GiftAid/Mock/SubmitMultiMultipleErrorsResponse.xml deleted file mode 100644 index 136a549..0000000 --- a/tests/GovTalk/GiftAid/Mock/SubmitMultiMultipleErrorsResponse.xml +++ /dev/null @@ -1 +0,0 @@ - 2.0
HMRC-CHAR-CLM-MULTI error submit 6359058085579170979 http://localhost:5665/LTS/LTSServlet XML 2021-10-12T18:09:03.009
ChRIS 3001 business Your submission failed due to business validation errors. Please see below for details. 8 ChRIS 4065 schema Invalid content found at element 'Sur' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Sur[1] cvc-type.3.1.3: The value '' of element 'Sur' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Sur[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_SurDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Fore' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Fore[1] cvc-type.3.1.3: The value '' of element 'Fore' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Fore[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ForeDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Sur' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-type.3.1.3: The value '' of element 'Sur' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_SurDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Fore' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-type.3.1.3: The value '' of element 'Fore' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ForeDonorGADRepaymentClaimR68'.
diff --git a/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimAckResponse.xml b/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimAckResponse.xml new file mode 100644 index 0000000..cc9f53c --- /dev/null +++ b/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimAckResponse.xml @@ -0,0 +1 @@ + 2.0
HMRC-CHAR-CLM response submit 9072983591062099772 http://localhost:5665/LTS/LTSServlet XML 2021-10-08T11:24:58.024
(count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body)=count(ancestor-or-self::node())) and (count(ancestor-or-self::node()|/gti:GovTalkMessage/gti:Body/*[name()='IRenvelope']/*[name()='IRheader']/*[name()='IRmark'])!=count(ancestor-or-self::node())) yPwKM0owwwzn3saHOT4rj02rqU0= ov+vziKsXzCpAHOZskSSp5yJptHB+fFilM8iaV3Agy7W9/xyqQfj98+uiOBqP73mwUzmZ9dyF7OQXIg75X/AgwNUHKGvId7i+L+XxlvCDoPm1QwBX+wliaCLXEXC9u2QHTDjz+8sUjyogZDlHJJdvfgEnhrX9kT4Ge9C4TAQRtQ= MIIDKTCCApKgAwIBAgIBAjANBgkqhkiG9w0BAQQFADB1MQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxGTAXBgNVBAcTEE9ha2Jyb29rIFRlcnJhY2UxEDAOBgNVBAoTB1NhcnZlZ2ExEDAOBgNVBAsTB1N1cHBvcnQxFDASBgNVBAMTC1NhcnZlZ2FEZW1vMB4XDTA0MTAwNzE2MDYwOFoXDTI5MTAwMTE2MDYwOFoweTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCElsbGlub2lzMRkwFwYDVQQHExBPYWticm9vayBUZXJyYWNlMRAwDgYDVQQKEwdTYXJ2ZWdhMRAwDgYDVQQLEwdTdXBwb3J0MRgwFgYDVQQDEw9TYXJ2ZWdhRGVtb0NlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOuak58DVFSXNRJzyvthjWYBn+yQX67cemqa1ZVF460RuwOCODZJHP8KlLnrJyZHVuBzlA0yHGKz5ABjpj/N7/IWxrC4LEH0Tuw1WCqaDTaSV2AtyEs7fgtopit6KM/yMGwqrDSHcuMi++yr5ynhfOS5uWZ9dSYwwmCtLmEauayfAgMBAAGjgcQwgcEwHQYDVR0OBBYEFH5QwQCCP0EqP0vwyRifonAT46ooMIGfBgNVHSMEgZcwgZSAFGU/dbDLz6UwZVm9DPwTghnj4tt6oXmkdzB1MQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxGTAXBgNVBAcTEE9ha2Jyb29rIFRlcnJhY2UxEDAOBgNVBAoTB1NhcnZlZ2ExEDAOBgNVBAsTB1N1cHBvcnQxFDASBgNVBAMTC1NhcnZlZ2FEZW1vggEAMA0GCSqGSIb3DQEBBAUAA4GBAJ7UjONH53zehnwbxNmLsr2FtdDSkQL9JFPEctPrjThu8w+4m/C8u+spUnIdPr9P3f5870L3/+EcePsXAc00xx4uqsrCkCD2unpKO7ZO0fqmvd2dMQqpcQv5Lm7jQa1HpmRcNwGiQhslp0K+oCxds2w4jZWt7W/l/H0Htg6kRnzD HMRC has received the HMRC-CHAR-CLM document ref: 92100000495393 at 11.24 on 08/10/2021. The associated IRmark was: ZD6AUM2KGDBQZZ66Y2DTSPRLR5G2XKKN. We strongly recommend that you keep this receipt electronically, and we advise that you also keep your submission electronically for your records. They are evidence of the information that you submitted to HMRC. Thank you for your submission 2021-10-08T11:24:58.024
diff --git a/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMissingNamesResponse.xml b/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMissingNamesResponse.xml new file mode 100644 index 0000000..4610e7e --- /dev/null +++ b/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMissingNamesResponse.xml @@ -0,0 +1 @@ + 2.0
HMRC-CHAR-CLM error submit 986769003220431383 http://localhost:5665/LTS/LTSServlet XML 2021-10-08T11:29:02.029
ChRIS 3001 business Your submission failed due to business validation errors. Please see below for details. 4 ChRIS 4065 schema Invalid content found at element 'Sur' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-type.3.1.3: The value '' of element 'Sur' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_SurDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Fore' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-type.3.1.3: The value '' of element 'Fore' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ForeDonorGADRepaymentClaimR68'.
diff --git a/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMultipleErrorsResponse.xml b/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMultipleErrorsResponse.xml new file mode 100644 index 0000000..966aa9f --- /dev/null +++ b/tests/GovTalk/GiftAid/Mock/SubmitNomineeClaimMultipleErrorsResponse.xml @@ -0,0 +1 @@ + 2.0
HMRC-CHAR-CLM error submit 6359058085579170979 http://localhost:5665/LTS/LTSServlet XML 2021-10-12T18:09:03.009
ChRIS 3001 business Your submission failed due to business validation errors. Please see below for details. 8 ChRIS 4065 schema Invalid content found at element 'Sur' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Sur[1] cvc-type.3.1.3: The value '' of element 'Sur' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Sur[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_SurDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Fore' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Fore[1] cvc-type.3.1.3: The value '' of element 'Fore' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[2]/r68:Donor[1]/r68:Fore[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ForeDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Sur' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-type.3.1.3: The value '' of element 'Sur' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Sur[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_SurDonorGADRepaymentClaimR68'. ChRIS 4065 schema Invalid content found at element 'Fore' /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-type.3.1.3: The value '' of element 'Fore' is not valid. ChRIS 4082 schema Value '' has an incorrect length /hd:GovTalkMessage[1]/hd:Body[1]/r68:IRenvelope[1]/r68:R68[1]/r68:Claim[1]/r68:Repayment[1]/r68:GAD[1]/r68:Donor[1]/r68:Fore[1] cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ForeDonorGADRepaymentClaimR68'.
From 1d69489d342f63b8baf12094303ae3914f9e8739 Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Tue, 19 Apr 2022 19:37:49 +0100 Subject: [PATCH 7/7] =?UTF-8?q?CLA-25=20=E2=80=93=20ensure=20`CHARID`=20is?= =?UTF-8?q?=20always=20the=20charity's=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GiftAid.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/GiftAid.php b/src/GiftAid.php index 96d17ae..256f313 100644 --- a/src/GiftAid.php +++ b/src/GiftAid.php @@ -1018,9 +1018,7 @@ protected function getCharIdKey(): string protected function getCharIdValue(): string { - return $this->isAgentClaim() - ? $this->agentDetails['number'] - : $this->getClaimingOrganisation()->getHmrcRef(); + return $this->getClaimingOrganisation()->getHmrcRef(); } protected function writeClaimStartData(XMLWriter $package, ClaimingOrganisation $org): void