Skip to content
This repository was archived by the owner on Dec 28, 2020. It is now read-only.

Commit 932ad65

Browse files
Exception message now contains traceId to request debug information from Tikkie provider
1 parent c878a1f commit 932ad65

10 files changed

+12
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ use PHPTikkie\Exceptions\PHPTikkieException;
117117
try {
118118
var_dump($tikkie->platforms());
119119
} catch (PHPTikkieException $exception) {
120-
print $exception->getMessage(); // [ERR_2005_002] The API Key is invalid for the requested resource (see https://developer.abnamro.com/get-started#obtaining-an-api-key)
120+
print $exception->getMessage(); // [ERR_2005_002] The API Key is invalid for the requested resource | traceId: 6fda2ce8-225d-4ca2-920a-b687c7aeb2f3 | (see https://developer.abnamro.com/get-started#obtaining-an-api-key)
121121
}

src/Exceptions/PHPTikkieException.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public function __construct($message, $code = 0, Exception $previous = null)
2222
if (count($this->errors) > 0) {
2323
$error = $this->errors[0];
2424

25-
$message = "[{$error->code}] {$error->message} (see {$error->reference})";
25+
$message = "[{$error->code}] {$error->message} "
26+
. "| traceId: {$error->traceId} | "
27+
. "(see {$error->reference})";
2628
}
2729
}
2830

tests/CreatePaymentRequestTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testCreatePaymentRequestFailed()
2929
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
3030

3131
$this->expectException(RequestException::class);
32-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
32+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
3333

3434
$this->newPaymentRequest()->save();
3535
}

tests/CreatePlatformTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testCreatePlatformFailed()
3333
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
3434

3535
$this->expectException(RequestException::class);
36-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
36+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
3737

3838
$this->newPlatform()->save();
3939
}

tests/CreateUserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testCreateUserFailed()
4343
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
4444

4545
$this->expectException(RequestException::class);
46-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
46+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
4747

4848
$this->newUser()->save();
4949
}

tests/EnvironmentTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testInvalidApiKeyHandling()
2020
$this->setMockHttpResponse('InvalidApiKey.txt');
2121

2222
$this->expectException(AccessTokenException::class);
23-
$this->expectExceptionMessage("[ERR_2005_001] The API Key is invalid (see https://developer.abnamro.com/get-started#obtaining-an-api-key)");
23+
$this->expectExceptionMessage("[ERR_2005_001] The API Key is invalid | traceId: 98de8459-377d-4834-a0a2-079f94f0f43d | (see https://developer.abnamro.com/get-started#obtaining-an-api-key)");
2424

2525
$this->tikkie->newPlatform()->save();
2626
}

tests/FetchPaymentRequestTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testFetchPaymentRequestFailed()
4848
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
4949

5050
$this->expectException(RequestException::class);
51-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
51+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
5252

5353
$this->tikkie->paymentRequest('platformtoken1', 'usertoken1', 'paymentrequesttoken1');
5454
}

tests/FetchPaymentRequestsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testFetchPaymentRequestsFailed()
5858
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
5959

6060
$this->expectException(RequestException::class);
61-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
61+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
6262

6363
$this->tikkie->paymentRequests('platformtoken1', 'usertoken1', 0, 10);
6464
}

tests/FetchPlatformsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testFetchUsersFailed()
3636
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
3737

3838
$this->expectException(RequestException::class);
39-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
39+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
4040

4141
$this->tikkie->platforms();
4242
}

tests/FetchUsersTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testFetchUsersFailed()
4242
$this->setMockHttpResponse(['AccessToken.txt', 'ValidationError.txt']);
4343

4444
$this->expectException(RequestException::class);
45-
$this->expectExceptionMessage("[ERR_1100_004] Field validation error (see https://developer.abnamro.com/api/tikkie/technical-details)");
45+
$this->expectExceptionMessage("[ERR_1100_004] Field validation error | traceId: 3cbf4bc9-108c-4e02-ad6e-937c79d875e3 | (see https://developer.abnamro.com/api/tikkie/technical-details)");
4646

4747
$this->tikkie->users('platformtoken1');
4848
}

0 commit comments

Comments
 (0)