7 Commits
1.1.2 ... 1.1.4

Author SHA1 Message Date
f60aa3e1bc Merge branch 'development'
PHPstan config updates, test file update
2021-11-25 17:45:13 +09:00
b041720a18 phpstan config updates, test code update 2021-11-25 17:44:04 +09:00
be6b2be55d Merge pull request #1 from arif-rh/minor-fix
Minor fix for README type on composer command and trailing , in config class
2021-11-25 17:42:33 +09:00
Arif RH
6163d26f50 minor fix Config 2021-11-25 14:55:55 +07:00
Arif RH
a4c06b9a36 minor fix README 2021-11-25 14:55:09 +07:00
24dc8426de Remove space from client interface 2021-10-27 17:55:29 +09:00
7ef4133537 Update composer json file to exclude test and static test files 2021-10-21 15:51:05 +09:00
6 changed files with 30 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ Amazon Gift Codes On Demand (AGCOD). Integration for Amazon Incentive API.
## How to install ## How to install
`composer request gullevek/amazon-incentives` `composer require gullevek/amazon-incentives`
## _ENV variables needed ## _ENV variables needed

View File

@@ -20,5 +20,8 @@
"minimum-stability": "dev", "minimum-stability": "dev",
"require": { "require": {
"php": ">=7.4.0" "php": ">=7.4.0"
},
"archive": {
"exclude": ["/test/", "/phpstan.neon", "/psalm.xml", "/.phan/", "/.vscode/"]
} }
} }

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

@@ -42,7 +42,7 @@ class Config implements ConfigInterface
?string $partner, ?string $partner,
?string $endpoint, ?string $endpoint,
?string $currency, ?string $currency,
?bool $debug, ?bool $debug
) { ) {
/** /**
* @psalm-suppress InvalidScalarArgument * @psalm-suppress InvalidScalarArgument

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 {