use product type if set to support consumables and subscriptions
[stouyapi.git] / bin / import-game-data.php
index 1eb783c7bb8fd1ed9269c7dd45d70279bacdcf13..0227b459ff3bbfa3bc22c73ef8c6d5d5742e731c 100755 (executable)
@@ -176,7 +176,7 @@ function buildDiscover(array $games)
     writeJson(
         'api/v1/discover-data/' . categoryPath('Random') . '.json',
         buildSpecialCategory(
-            'Random' . date('Y-m-d H:i'),
+            'Random ' . date('Y-m-d H:i'),
             filterRandom($games, 99)
         )
     );
@@ -380,12 +380,13 @@ function buildProduct($product)
         return null;
     }
     return [
-        'type'          => 'entitlement',
+        'type'          => $product->type ?? 'entitlement',
         'identifier'    => $product->identifier,
         'name'          => $product->name,
         'description'   => $product->description ?? '',
         'localPrice'    => $product->localPrice,
         'originalPrice' => $product->originalPrice,
+        'priceInCents'  => $product->originalPrice * 100,
         'percentOff'    => 0,
         'currency'      => $product->currency,
     ];