diff --git a/src/GiftAid.php b/src/GiftAid.php index 8039f8e..326fbb2 100644 --- a/src/GiftAid.php +++ b/src/GiftAid.php @@ -1180,6 +1180,7 @@ public function getResponseErrors() $govTalkErrors['business'][] = [ 'number' => (string) $gaError->Number, + 'message' => $gaError->Application->Messages->DeveloperMessage ?? '', 'text' => (string) $gaError->Text, 'location' => (string) $gaError->Location, 'donation_id' => $donationId, diff --git a/tests/GovTalk/GiftAid/GiftAidTest.php b/tests/GovTalk/GiftAid/GiftAidTest.php index 88be061..e33692f 100644 --- a/tests/GovTalk/GiftAid/GiftAidTest.php +++ b/tests/GovTalk/GiftAid/GiftAidTest.php @@ -492,6 +492,11 @@ public function testMultiClaimSubmissionWithFirstDonationNamesMissing(): void $this->assertCount(0, $response['errors']['warning']); $this->assertCount(4, $response['errors']['business']); + $this->assertEquals( + "cvc-type.3.1.3: The value '' of element 'Sur' is not valid.", + $response['errors']['business'][1]['message'], + ); + $this->assertEquals( "Invalid content found at element 'Sur'", $response['errors']['business'][1]['text'],