Skip to content

Commit

Permalink
Merge pull request #12 from thebiggive/CLA-19-fix-missing-msg
Browse files Browse the repository at this point in the history
CLA-19 – fix surfacing developer detail as 'message' in biz errors
  • Loading branch information
alihejazi authored Apr 19, 2022
2 parents 7b8671b + 0e08c41 commit 52c761f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/GiftAid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions tests/GovTalk/GiftAid/GiftAidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 52c761f

Please sign in to comment.