1414use Shopware \App \SDK \Shop \ShopInterface ;
1515
1616/**
17- * @phpstan-type InAppPurchaseArray= array{identifier: string, quantity: int, nextBookingDate?: string, sub: string}
17+ * @phpstan-type InAppPurchaseArray array{identifier: string, quantity: int, nextBookingDate?: string, sub: string}
1818 */
1919class InAppPurchaseProvider
2020{
@@ -27,21 +27,19 @@ public function __construct(
2727 /**
2828 * @param non-empty-string $encodedPurchases
2929 * @return Collection<InAppPurchase>
30- * @throws \Exception
3130 */
3231 public function decodePurchases (string $ encodedPurchases , ShopInterface $ shop , bool $ retried = false ): Collection
3332 {
3433 try {
3534 $ keys = $ this ->keyFetcher ->getKey ($ retried );
3635 $ signatureValidator = new HasValidRSAJWKSignature ($ keys );
37- $ domainValidator = new HasMatchingDomain ($ shop );
3836
3937 $ parser = new Parser (new JoseEncoder ());
4038 /** @var Token\Plain $token */
4139 $ token = $ parser ->parse ($ encodedPurchases );
4240
4341 $ validator = new Validator ();
44- $ validator ->assert ($ token , $ signatureValidator, $ domainValidator );
42+ $ validator ->assert ($ token , $ signatureValidator );
4543
4644 return $ this ->transformClaims ($ token );
4745 } catch (\Exception $ e ) {
@@ -51,7 +49,7 @@ public function decodePurchases(string $encodedPurchases, ShopInterface $shop, b
5149
5250 $ this ->logger ->error ('Failed to decode in-app purchases: ' . $ e ->getMessage ());
5351
54- throw $ e ;
52+ return new Collection () ;
5553 }
5654 }
5755
0 commit comments