6 Commits
1.1.3 ... 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
5 changed files with 26 additions and 5 deletions

View File

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

View File

@@ -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

View File

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

View File

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

View File

@@ -181,6 +181,28 @@ if ($run_gift_tests === true) {
}
print "<br>";
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
try {