From 24dc8426de348891fbda3ef80a0d4928b4a74e12 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 27 Oct 2021 17:55:29 +0900 Subject: [PATCH 1/2] Remove space from client interface --- src/Client/ClientInterface.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Client/ClientInterface.php b/src/Client/ClientInterface.php index ef0b66a..2471a94 100644 --- a/src/Client/ClientInterface.php +++ b/src/Client/ClientInterface.php @@ -12,7 +12,6 @@ interface ClientInterface * * @return String */ - public function request(string $url, array $headers, $params): string; } From b041720a18ad75529a3276dcd3e7f7deb3cdf632 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 25 Nov 2021 17:44:04 +0900 Subject: [PATCH 2/2] phpstan config updates, test code update --- phpstan.neon | 4 ++-- test/aws_gift_card_tests.php | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 279478d..dff4b90 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,10 +2,10 @@ parameters: tmpDir: /tmp/phpstan-codeblocks-amazon-incentives - level: max + level: 8 paths: - %currentWorkingDirectory% - excludes_analyse: + excludePaths: # ignore composer - vendor # ignore errores with diff --git a/test/aws_gift_card_tests.php b/test/aws_gift_card_tests.php index 260c3d0..eb02998 100644 --- a/test/aws_gift_card_tests.php +++ b/test/aws_gift_card_tests.php @@ -181,6 +181,28 @@ if ($run_gift_tests === true) { } print "
"; 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: " . dateTr($expiration_date) . ", " + . "CLAIM CODE: " . $claim_code . ""; + if ($debug_print === true) { + print "
" . print_r($aws_test, true) . "
"; + } + 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 "
"; + sleep($debug_wait); // set same request ID twice to get same response test try {