Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f60aa3e1bc | |||
| b041720a18 | |||
| be6b2be55d | |||
|
|
6163d26f50 | ||
|
|
a4c06b9a36 | ||
| 24dc8426de | |||
| 7ef4133537 |
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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/"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user