Haha, right.... a legend I am not, I'd settle for making the minimum wage, which in my country would be around 300$ per month.
Anyway sudeep98 , here's what I think are the right steps.
1. First of all I used cranberry's IAP plugin, so if you try and it doesn't work with the other one, then I suggest you purchase the latest version from cranberry's site.
2. Then you need to put the plugin in your project and upload an apk that uses the plugin to the google console. That will add an extra permission in the console "com.android.vending.BILLING"
3. After that permission is added you can then add iaps to your project in the console. So choose their names, prices, etc. and activate them.
4. Once you're done with all that copy that huuugeee RSA key from services&apis and paste it in C2 in the properties of the iap plugin.
5. Then you set up the events in C2, how you do this is mostly up to you, obviously your needs are gonna differ from mine... What you do have to keep in mind here is the order of the iap plugin's events. First you add the product ids, then you request the store listing and then you can purchase products.
So for example in my game I have:
So what I did there was, I added the products(these names have to be an exact match to what you entered in the google console!!), then I requested the store listing, then a little animation for the button, and then I went to the donation layout. And only then on that layout I have events that include phonegapiap|purchase product "donate1" or purchase donate2, etc.
Now like I said how you set up your events in entirely up to you. You could have it all in the same layout for example. First you make an event where you add the products and request the store listing, then underneath it you could have an event "phonegapiap|on store listing success" create a bunch of objects, place them on the screen in the right places, etc. you get the idea.
6. Do you use intelxdk or cocoonio?