创建Google应用内商品时的inAppProductRegionsMissingPricing

时间:2018-07-18 06:39:49

标签: php laravel in-app

我正在使用this库在Google Play中创建应用内商品。 这是我在创建新的应用内商品时使用的代码。

$googlePrice = new \Google_Service_AndroidPublisher_Price();
$googlePrice->setCurrency($currency);
$googlePrice->setPriceMicros($priceInMicros);

$googleInAppProduct = new \Google_Service_AndroidPublisher_InAppProduct();

$googleInAppProduct->setDefaultPrice($googlePrice);
$googleInAppProduct->setSku($sku);
$googleInAppProduct->setStatus('active');
$googleInAppProduct->setPurchaseType($purchaseType);
$googleInAppProduct->setDefaultLanguage($defaultLanguage);
$googleInAppProduct->setPackageName($packageName);
$googleInAppProduct->setListings($listings);


$service->inappproducts->insert(
    $packageName,
    $googleInAppProduct,
    ['autoConvertMissingPrices' => true]
);

$ service的类型为\ Google_Service_AndroidPublisher。

但是,如果Google Play中的游戏在许多国家/地区发行,则无法正常运行。我收到此错误:

{
 "error": {
  "errors": [
   {
    "domain": "androidpublisher",
    "reason": "inAppProductRegionsMissingPricing",
    "message": "Must provide a price for each region the app has been published in."
   }
  ],
  "code": 403,
  "message": "Must provide a price for each region the app has been published in."
 }
}

即使将autoConvertMissingPrices设置为true,为什么仍会发生这种情况?它不应该根据我设置的默认价格自动将价格转换为其他国家吗?如果不起作用,该如何将默认价格手动转换为其他货币?

0 个答案:

没有答案