I suspect that you would want to set these up as separate products. We are basically a pass-through service for the various stores, you would want to confirm with the stores regarding bundles.
Have you tested this? I’m not sure how multiple products would work in this purchasing flow, are you expecting a store purchase popup for each product within the bundle? This would likely be the user experience. Unless I’m misunderstanding, and the bundle is a separate/individual product as suggested. After they purchased this single product/bundle, you would unlock the corresponding items on the client.
No, I did not test neither start to develop, just making the design. I will not perform transactions for each product inside the bundle, it will be all handled at the client side, so no pop-ups.
At the Purchaser script from Unity, BuyProductID(string productId) function takes productId as argument, then calls ProcessPurchase(PurchaseEventArgs args) function if the productId is available at the store.
Bundled products will be handled at the ProcessPurchase( PurchaseEventArgs args) function:
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
if (String.Equals(args.purchasedProduct.definition.id, singlePack, StringComparison.Ordinal))
{
UnlockSinglePack(args.purchasedProduct.definition.id);
}
else if (String.Equals(args.purchasedProduct.definition.id, bundlePack, StringComparison.Ordinal))
{
UnlockMultiplePacks(args.purchasedProduct.definition.id);
}
else
{
PurchaseFailed();
}
return PurchaseProcessingResult.Complete;
}
The most important point is the naming for the products to be parsed.
Why parse the name at all? If they buy Bundle #2 for example (a single product), then unlock the items that you already know are in that bundle. Perhaps that is what you are doing in UnlockMultiplePacks. But your implementation looks sound in general.
Exactly, UnlockMultiplePacks will be unlocking multiple items where each of them individually being sold as a single item. Thank you for the answer Hoping that it will work as planned…