UniPay - In App Purchase (IAP) Billing - Shop solution

Oh I think I maybe found the issue? Right now all my prices are in USD. Some regions might require regional pricing.

Edit: After looking around for a bit, I’m not seeing anything that suggests this would fix the issue.

@Baroni1 I noticed in your sample you use

“price”: “1;VLV100”

In steam’s documentation it says to use:
“price_category” : “1;VLV100”

In my setup I’m doing

“price”: “1;USD099”

So far no one’s had any issues with this… Just wondering if this might be a cause for issue

@Benajben never heard of that before and unsure how Steam converts fixed pricing like USD099 to local pricing or a pricing tier like VLV100. I am currently in the process of creating a Steam account located in Brazil via VPN to test this. Will report back when I have more details.

@Baroni1 thanks a bunch! I was also going to try that haha. I think Brazil does have some strange rules around gaming though.

After testing, I have not found any issues with this. I have tried the usual VLV100 as well as USD100, both were converted into local R$ at around R$5.08. So not only did the store initialize correctly with a Brazilian account, but Steam’s local currency conversion works as expected too. I’m clueless on how to reproduce this, maybe you would want to follow up with Steam support so they could check this specific user?

Thanks for checking this out. The user reported they could make purchases in Brawlhala. I haven’t had any others from Brazil reach out to me either. I did add a ton error logs to the build and had them send me there logs and was unable to see any of them (not sure if SimpleIAP filters out logs).

I’ll reach out to Steam and see.

@Baroni1 @anon_1121049 Good luck on fixing this fast, for sure u’ll find the bug soon!

Aside from that I got good news: Managed to make the shop dynamic with Playfab Title Data. It’s important to first TryParse the Product ID, if you don’t do so, shop items in the category currencies aren’t instantiated since they aren’t just an ID that can be parsed to int. It works like a charm, I so love your asset. As soon as you get into the code just a little bit, it becomes really really powerful!

Greetings to everyone

1 Like

Hi @Baroni1
I could finally test In-App Purchases, and on Android I get this error:
Exception
NullReferenceException: Object reference not set to an instance of an object.
Unity.Services.Analytics.TransactionCurrencyConverter.Convert (System.String currencyCode, System.Double value) (at <00000000000000000000000000000000>:0)
UnityEngine.Purchasing.AnalyticsAdapter.GenerateRealCurrencySpentOnPurchase (UnityEngine.Purchasing.Product product) (at <00000000000000000000000000000000>:0)
UnityEngine.Purchasing.AnalyticsAdapter.BuildTransactionFailedParameters (UnityEngine.Purchasing.Product product, UnityEngine.Purchasing.PurchaseFailureReason reason) (at <00000000000000000000000000000000>:0)
UnityEngine.Purchasing.AnalyticsAdapter.SendTransactionFailedEvent (UnityEngine.Purchasing.Product product, UnityEngine.Purchasing.PurchaseFailureReason reason) (at <00000000000000000000000000000000>:0)
UnityEngine.Purchasing.AnalyticsClient.OnPurchaseFailed (UnityEngine.Purchasing.Product product, UnityEngine.Purchasing.PurchaseFailureReason reason) (at <00000000000000000000000000000000>:0)
UnityEngine.Purchasing.StoreListenerProxy.OnPurchaseFailed (UnityEngine.Purchasing.Product i, UnityEngine.Purchasing.PurchaseFailureReason p) (at <00000000000000000000000000000000>:0)
SIS.IAPManager.Purchase (System.String productID) (at <00000000000000000000000000000000>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <00000000000000000000000000000000>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <00000000000000000000000000000000>:0)
UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) (at <00000000000000000000000000000000>:0)
UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () (at <00000000000000000000000000000000>:0)
UnityEngine.EventSystems.StandaloneInputModule.Process () (at <00000000000000000000000000000000>:0)
UnityEngine.EventSystems.StandaloneInputModule:process()

What could it be?

Edit: I See In-App Purchases Service was deactivated in Unity, trying again now with “ON”.

@Gushmeister Unity Services is a separate package, or actually two (Core + Analytics) now, which is described on the install instructions. Are those packages available in your project? It seems the error is on converting the product price in the TransactionCurrencyConverter.Convert method - not sure what is expected there though. What’s your product price as defined in the IAP Settings editor, a string or number?

Could you state the version of Unity Services Core + Unity IAP you are using so I could try to reproduce?

Hi @Baroni1
can you let me know where I can download an older version of SIS? i need to update my game to the current version of SIS. (The SIS which is present in my project is older than version 4.3.7)

I bought the current version of SIS. So can you provide me with a previous version of SIS, it could be 4.3.7…

Hello @Sheyk2022 , as recommended multiple times, I would really, really suggest you update to the latest 5.x version for being able to publish to App Stores. You will not be able to release apps with SIS 4.3.7 or lower due to the requirement of Unity IAP 4.4.0+.

If you’ve bought SIS on the Unity Asset Store, there is no way to download older versions. I do not distribute the asset via email manually or by other means. If you’ve bought it on my website, you have access to version control (see all code differences between versions) and also download all older versions down to 4.3.7.

Actually what I wanted to do was update the code itself based on the changelog. but unfortunately I will have to update using version 5. I didn’t know that it was only possible to access older versions through your website… Thanks for the answer

Forgive me if this has already been asked, but are there plans to make this package capable of integration with the Epic Game Store? Or would we need to make our own custom store to integrate with Unity IAP to achieve this? Thanks

You are actually the first person asking this :slight_smile: Currently there are no plans to support the EGS due to almost no one being able to profit from it. My last information was that the Epic Games Store is invite only, may I ask if that changed or did they accept your application already?

They’ve recently opened it up to more developers, though I don’t believe it’s as open as Steam. It’s quite possible that it’s still not worth the effort to modify the plugin to support it.

Currently, I’m evaluating the work of having your plugin communicate with Epic services through their plugin located here: GitHub - PlayEveryWare/eos_plugin_for_unity: Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.

The epic plugin allows Epic services (such as authentication and store) to communicate with the developer’s own application.

For us it’s more of a curiosity at this point. Again, might not be worth the effort.

Thank you for the feedback @christokkies ! I took a look at the plugin you linked and it would be possible to implement a custom store for this. However I would need an application on the Epic Store to test this, so if you have no urgency for it, that’s currently not planned.

Hi @Baroni1 thanks for you help, as last time asked, the problem with Android Shop not working was because I didn’t activate in app, now everything works and was also Sandbox-Tested, very cool :-).

Got some last questions before I release:
1.) Do I always need a Restore Purchases Button? As I’m using Playfab as my Serverbackend, all items are synched there. But yeah, the user could definitely lose all of his Purchases, if he’d lose his account, his account gets hacked or E-Mail changed somehow, so I think that I’d need to. That’s why I’ve integrated it already, but when pressing it, nothing happens, also no Debug-Messages? Or is that fine, since there’s no items to restore. How could I check that? If I understood it right, the user could just make a new Account and press the Restore-Button to have his items in this new account, or am I wrong with that? That way users could make multiple accounts and just share their info with friends. So again: Do I really need that restore purchases Button?

What does exactly happen, when a user activates this, for money users buy coins, are the items bought with coins then also restored?

2.) What happens, if a user buys a Coins-Pack for real money and buys items with it - and then wants revenue or his money back for the Coins-Pack he bought. Does SIS also consider this, and if yes, how does SIS know, that Skin X,Y was bought with those coins?

As always, thanks for your kind help mate!

On Apple, yes - Apple could reject your app if you don’t have one. On Google Play its optional since the user’s purchases are with his/her PlayFab account anyway. Note that the “Restore Purchases” button is for the products, not the user’s account. There are other ways to restore an PlayFab account but this happens outside of Simple IAP System.

Obviously nothing happens if the user does not have any purchases associated with his/her account. Although difficult, you would be able to test this with a purchase on the user’s device that exists locally but has not been sent to PlayFab yet. Pressing the restore button should then send the receipt to PlayFab. This is nothing that would occur in a production app though since it would mean that the user made the purchase in a version without PlayFab and then you added PlayFab later.

Users can only restore products they already own, or just unlocked. They send a list of products to PlayFab which they have retrieved from PlayFab during login earlier (so the same products), or additional products they unlocked during the session for free. This makes sure that although unlikely, users can continue to use their purchases in the event of unpredicted exceptions or major functional failure in the inventory workflow of your app (i.e. your app code accidentally deleting all DBManager inventory after login).

As explained above, due to the user sending only current purchases it is not possible to associate them with other accounts. Also, if they would send the original Unity IAP receipts again, PlayFab would decline them as duplicate.

The “Restore Purchases” button does not restore consumable products (which would then e.g. grant coins again), but everything else in the user’s inventory.

Simple IAP System retrieves inventory from PlayFab. SIS is not aware of something that happens outside your app on the App Store (a refund), eventually while the app is not even running, as the App Store does not communicate this without using server notifications. Instead, PlayFab could use these notifications, but they do not. If you are talking about Google Play, a user can only make one refund per app, so the potential of misuse is limited. If this is something that concerns you, you would check the refunded transactions in your Google Play orders list, then go into PlayFab and subtract coins / remove an item from the corresponding user.

Hi @Baroni1 thanks for your Feedback, everything is clear now!

I was trying to make my final test for iOS stores, but the pictures on your website are not shown, neither for android nor for apple. See this link:

Did you change something on your Webserver?

Thanks for the notice. Images are hosted externally, and the image hoster seems to be offline since 17 hours. I will monitor its availability during the day.

1 Like