Merge branch 'development'

PHPstan config updates, test file update
This commit is contained in:
2021-11-25 17:45:13 +09:00
3 changed files with 24 additions and 3 deletions

View File

@@ -2,10 +2,10 @@
parameters: parameters:
tmpDir: /tmp/phpstan-codeblocks-amazon-incentives tmpDir: /tmp/phpstan-codeblocks-amazon-incentives
level: max level: 8
paths: paths:
- %currentWorkingDirectory% - %currentWorkingDirectory%
excludes_analyse: excludePaths:
# ignore composer # ignore composer
- vendor - vendor
# ignore errores with # ignore errores with

View File

@@ -12,7 +12,6 @@ interface ClientInterface
* *
* @return String * @return String
*/ */
public function request(string $url, array $headers, $params): string; public function request(string $url, array $headers, $params): string;
} }

View File

@@ -181,6 +181,28 @@ if ($run_gift_tests === true) {
} }
print "<br>"; print "<br>";
sleep($debug_wait); sleep($debug_wait);
// request same card again and get error
try {
$aws_test = AmazonIncentives::make()->buyGiftCard((float)$value, $creation_request_id);
$request_status = $aws_test->getStatus();
// same?
$claim_code = $aws_test->getClaimCode();
$expiration_date = $aws_test->getExpirationDate();
print "AWS: buyGiftCard: CANCLED SAME CODE AGAIN: " . $request_status . ": "
. "creationRequestId: " . $creation_request_id . ", gcId: " . $gift_card_id . ", "
. "EXPIRE DATE: <b>" . dateTr($expiration_date) . "</b>, "
. "CLAIM CODE: <b>" . $claim_code . "</b>";
if ($debug_print === true) {
print "<pre>" . print_r($aws_test, true) . "</pre>";
}
fwrite($fp, writeLog((array)$aws_test));
} catch (\Exception $e) {
$error = AmazonIncentives::decodeExceptionMessage($e->getMessage());
printException('buyGiftCard', $e->getCode(), $error, $debug_print);
fwrite($fp, writeLog($error));
}
print "<br>";
sleep($debug_wait);
// set same request ID twice to get same response test // set same request ID twice to get same response test
try { try {