@luhpatez
Are you using the plugin mentioned above that updates play billing? I am using it on 5.2.1 and it took some tweeking. I got it to work tho.
I had to add these extra permissions in project settings, one of which requires a privacy policy.
You can use google sites to setup a webpage for your privacy policy, unless you already have a web page for your game. I used google sites because it is free. Then i googled “free game privacy policy” and it generated it all for me. Example: Privacy Policy | FormsTemplates
Without that in place and setup in the play console, you can’t take IAP because you are dealing with credit card info i guess.
I googled like crazy to get my license key but i had to totally fill all of this stuff out in project settings:
Once i was done there, it was as simple as this:
Added this event in my persistent level. the event can be ‘begin play’ i just have other things that have to load first.
In my widget where i made my store i added this:
To explain a bit, The product identifier is the EXACT name (case sensitive) of the name of the IAP i made in google play console:
tick “is consumable.” then all you need is the Make an in-app purchase v2 node connected to player controller.
The rest of that is a ref to my character (where the diamond value is stored), the increase of 10 diamonds, and then a save. The blood diamond use function node is just updating my HUD, and the save node is my personal saving function. Whatever your save system looks like, you would just replace that logic. I save here because i don’t want someone to buy, close the game/game crash/etc. and then i have to deal with them not having what they paid for.
Hope that helps some. When i got it working, it was far less complicated than i thought.
I am assuming you have already setup google cloud API, oAuth, and credentials? That was a mess for me but i stumbled through it somehow.