Merge pull request #48 from cyl3x/fix/missing-transaction-validation-… #158
Annotations
10 warnings
|
unit:
src/Response/PaymentResponse.php#L113
Escaped Mutant for Mutator "UnwrapArrayFilter":
@@ @@
*/
public static function redirectUrl(string $status, string $url): ResponseInterface
{
- return self::createResponse(array_filter(['status' => $status, 'redirectUrl' => $url]));
+ return self::createResponse(['status' => $status, 'redirectUrl' => $url]);
}
/**
* @param array<mixed> $data
|
|
unit:
src/HttpClient/AuthenticatedClient.php#L63
Escaped Mutant for Mutator "CastString":
@@ @@
throw new AuthenticationFailedException($this->shop->getShopId(), $response);
}
$this->cache->set($cacheKey, $token['access_token'], $token['expires_in'] - self::TOKEN_EXPIRE_DIFF);
- return (string) $token['access_token'];
+ return $token['access_token'];
}
/**
* @throws \JsonException
|
|
unit:
src/HttpClient/AuthenticatedClient.php#L49
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
}
$body = $response->getBody()->getContents();
try {
- $token = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
+ $token = json_decode($body, true, 513, JSON_THROW_ON_ERROR);
} catch (\JsonException) {
throw new AuthenticationFailedException($this->shop->getShopId(), $response);
}
|
|
unit:
src/HttpClient/AuthenticatedClient.php#L49
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
}
$body = $response->getBody()->getContents();
try {
- $token = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
+ $token = json_decode($body, true, 511, JSON_THROW_ON_ERROR);
} catch (\JsonException) {
throw new AuthenticationFailedException($this->shop->getShopId(), $response);
}
|
|
unit:
src/HttpClient/AuthenticatedClient.php#L43
Escaped Mutant for Mutator "Throw_":
@@ @@
}
$response = $this->client->sendRequest($this->createTokenRequest($this->shop));
if ($response->getStatusCode() !== 200) {
- throw new AuthenticationFailedException($this->shop->getShopId(), $response);
+ new AuthenticationFailedException($this->shop->getShopId(), $response);
}
$body = $response->getBody()->getContents();
try {
|
|
unit:
src/Context/ContextResolver.php#L346
Escaped Mutant for Mutator "NullSafeMethodCall":
@@ @@
if (!\is_string($source['inAppPurchases']) || empty($source['inAppPurchases'])) {
throw new MalformedWebhookBodyException();
}
- $inAppPurchases = $this->inAppPurchaseProvider?->decodePurchases($source['inAppPurchases'], $shop);
+ $inAppPurchases = $this->inAppPurchaseProvider->decodePurchases($source['inAppPurchases'], $shop);
}
return new ActionSource($source['url'], $source['appVersion'], $inAppPurchases ?? new Collection());
}
}
|
|
unit:
src/Context/ContextResolver.php#L265
Escaped Mutant for Mutator "NullSafeMethodCall":
@@ @@
if (!\is_string($claims['inAppPurchases']) || empty($claims['inAppPurchases'])) {
throw new MalformedWebhookBodyException();
}
- $inAppPurchases = $this->inAppPurchaseProvider?->decodePurchases($claims['inAppPurchases'], $shop);
+ $inAppPurchases = $this->inAppPurchaseProvider->decodePurchases($claims['inAppPurchases'], $shop);
}
return new StorefrontAction($shop, new StorefrontClaims($claims), $inAppPurchases ?? new Collection());
}
|
|
unit:
src/Context/ContextResolver.php#L163
Escaped Mutant for Mutator "Coalesce":
@@ @@
new OrderTransaction($body['orderTransaction']),
isset($body['recurring']) ? new RecurringData($body['recurring']) : null,
// Support both Shopware 6.7 (requestData) and 6.6 (queryParameters) for backward compatibility
- $body['requestData'] ?? $body['queryParameters'] ?? []
+ $body['queryParameters'] ?? $body['requestData'] ?? []
);
}
public function assemblePaymentCapture(RequestInterface $request, ShopInterface $shop): PaymentCaptureAction
|
|
unit:
src/Context/ContextResolver.php#L163
Escaped Mutant for Mutator "Coalesce":
@@ @@
new OrderTransaction($body['orderTransaction']),
isset($body['recurring']) ? new RecurringData($body['recurring']) : null,
// Support both Shopware 6.7 (requestData) and 6.6 (queryParameters) for backward compatibility
- $body['requestData'] ?? $body['queryParameters'] ?? []
+ $body['requestData'] ?? [] ?? $body['queryParameters']
);
}
public function assemblePaymentCapture(RequestInterface $request, ShopInterface $shop): PaymentCaptureAction
|
|
unit:
src/Context/ContextResolver.php#L99
Escaped Mutant for Mutator "NullSafeMethodCall":
@@ @@
if (!empty($params['in-app-purchases'])) {
/** @var non-empty-string $inAppPurchaseString */
$inAppPurchaseString = $params['in-app-purchases'];
- $inAppPurchases = $this->inAppPurchaseProvider?->decodePurchases($inAppPurchaseString, $shop);
+ $inAppPurchases = $this->inAppPurchaseProvider->decodePurchases($inAppPurchaseString, $shop);
}
return new ModuleAction($shop, $params['sw-version'], $params['sw-context-language'], $params['sw-user-language'], $inAppPurchases ?? new Collection());
}
|