You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2022. It is now read-only.
If a product is listed in inapps_products.xml, but only available in certain countries, billing setup would fail to complete for users in unsupported countries. Setup fails even if a subset of products are available to such users. This makes it impossible to create items that are only available in certain countries, or which should be removed from sale for cultural reasons. Currently, setup is all-or-nothing.
Setup fails in FortumoBillingService.java in getFortumoInapps(), throwing a "Carrier not supported" exception. Possible solution:
static Map<String, FortumoProduct> getFortumoInapps(Context context, boolean isNook) throws IOException, XmlPullParserException, IabException {
final Map<String, FortumoProduct> map = new HashMap<String, FortumoProduct>();
final InappsXMLParser inappsXMLParser = new InappsXMLParser();
final Pair<List<InappBaseProduct>, List<InappSubscriptionProduct>> parse = inappsXMLParser.parse(context);
final List<InappBaseProduct> allItems = parse.first;
final Map<String, FortumoProductParser.FortumoDetails> fortumoSkuDetailsMap = FortumoProductParser.parse(context, isNook);
int itemsNotSupportedCount = 0;
for (InappBaseProduct item : allItems) {
final String productId = item.getProductId();
final FortumoProductParser.FortumoDetails fortumoDetails = fortumoSkuDetailsMap.get(productId);
if (fortumoDetails == null) {
throw new IabException(IabHelper.IABHELPER_ERROR_BASE, "Fortumo inapp product details were not found");
}
final String serviceId = isNook ? fortumoDetails.getNookServiceId() : fortumoDetails.getServiceId();
final String serviceInAppSecret = isNook ? fortumoDetails.getNookInAppSecret() : fortumoDetails.getServiceInAppSecret();
List fetchedPriceData = MpUtils.getFetchedPriceData(context, serviceId, serviceInAppSecret);
if (fetchedPriceData == null || fetchedPriceData.size() == 0) {
final boolean supportedOperator = MpUtils.isSupportedOperator(context, serviceId, serviceInAppSecret);
if (supportedOperator) {
fetchedPriceData = MpUtils.getFetchedPriceData(context, serviceId, serviceInAppSecret);
} else {
if (isDebugLog()) {
Log.d(TAG, productId + " not available for this carrier" );
}
itemsNotSupportedCount++;
continue;
}
}
String price = null;
if (fetchedPriceData != null && !fetchedPriceData.isEmpty()) {
price = (String) fetchedPriceData.get(0);
}
FortumoProduct fortumoProduct = new FortumoProduct(item, fortumoDetails, price);
map.put(productId, fortumoProduct);
}
if ( itemsNotSupportedCount == allItems.size() )
{
throw new IabException(IabHelper.IABHELPER_ERROR_BASE, "No inventory available for this carrier/country.");
}
return map;
}
If a product is listed in inapps_products.xml, but only available in certain countries, billing setup would fail to complete for users in unsupported countries. Setup fails even if a subset of products are available to such users. This makes it impossible to create items that are only available in certain countries, or which should be removed from sale for cultural reasons. Currently, setup is all-or-nothing.
Setup fails in FortumoBillingService.java in getFortumoInapps(), throwing a "Carrier not supported" exception. Possible solution: