Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InApp Payment System (IAP) #146

Closed
wants to merge 17 commits into from

Conversation

@noblemaster
Copy link
Member

noblemaster commented Dec 12, 2012

Ditto before - moved to a separate branch "noblemaster-IAP".

@acoppes

This comment has been minimized.

Copy link

acoppes commented on 1f21843 Oct 30, 2012

About using the configuration and .net interface to get the purchase manager, I believe you could directly inject your application listener or we could use another API for managers or something.

For example:

// on Android
MyGame game = new MyGame();
game.setPurchaseManager(new GooglePlayPurchaseManager());

// on iOS
MyGame game = new MyGame();
game.setPurchaseManager(new AppStorePurchaseManager());

So in this way we don't have to do anything to the current Gdx API, just provide the PurchaseManager API and different implementations for each backend, but then the user is responsible on using one or the other.

I like that approach but I know people could prefer to use it directly from the Gdx.net (or Gdx.anothername) API.

This comment has been minimized.

Copy link

acoppes replied Oct 30, 2012

Just to know, why didn't you named the Observer/Processor as PurchaseListener or something like that? (sorry if I make tons of comments, I wanted to keep them separated)

This comment has been minimized.

Copy link

acoppes replied Oct 30, 2012

In general I like it even though I don't have any experience with in app purchases.

Christoph Aschwanden added 11 commits Oct 31, 2012
@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented Dec 12, 2012

Cool beans! I'm on a break, i'll be back soonish. We need to finish off the Net API as well. Feeling dirty having it not fully implemented.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented Dec 12, 2012

No worries, it's no rush :-D Enjoy your break!

@acoppes

This comment has been minimized.

Copy link
Member

acoppes commented Dec 12, 2012

Well, added more code recently to that httpimplementation branch.

On Wed, Dec 12, 2012 at 6:58 AM, Mario Zechner notifications@github.comwrote:

Cool beans! I'm on a break, i'll be back soonish. We need to finish off
the Net API as well. Feeling dirty having it not fully implemented.


Reply to this email directly or view it on GitHubhttps://github.com//pull/146#issuecomment-11281257.

Gemserk Studios http://blog.gemserk.com

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented Dec 12, 2012

Yeah, I saw your changes for HTTP. Looking good :-D Sorry, didn't find any time to help out.

@rgarat

This comment has been minimized.

Copy link
Member

rgarat commented Dec 12, 2012

Dont forget the new awesome google inapp api v3
On Dec 12, 2012 9:03 AM, "Christoph Aschwanden" notifications@github.com
wrote:

Yeah, I saw your changes for HTTP. Looking good :-D Sorry, didn't find any
time to help out.


Reply to this email directly or view it on GitHubhttps://github.com//pull/146#issuecomment-11284775.

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented Mar 20, 2013

Been working a bit on inapp stuff today (Ouya, ugh...). I think your PurchaseManager and Product interfaces/classes hold up pretty well. I'm not sure we need the validator. At least Ouya and Google Play get away with not having a validation server. If a user wants to have that, it's independent from the client side code imo.

On the PurchaseManager interface: i think each method should take a listener instead of setting the listener once.

I also think this thing should be an extension instead of being part of core. I'll create a branch in this repo for the iap-api, and the corresponding project structure for the extension asap. We can then close this PR.

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented Mar 20, 2013

Also, it seems that you can in fact query your app's product list with the Play Store v3 API now. You can also do that on Ouya. Not sure about iOS, anyone know more?

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented Mar 20, 2013

Agreed with making it an extension! Don't quite know how to add one, so I hope you figure it out :-P

re-validation server: Yes, definitely not needed for Mobile/Ouya. However, we need something for Desktop unless we use the Apple App Store or Windows 8 (I believe they provide IAP?). In any case, we should probably defer that to later. Probably not feasible for now.

re-product listing: yes, I believe that's in Google Play v3. However, I am not sure if Amazon (it's actually a good market to publish) offers listing services? Also, there might be other minor markets that don't support it. Forgot what it was on iOS? It's a while that I did the "research". The code I wrote represents the least common parts all the IAP services provide. Obviously there is more; e.g. iOS offers download options of item data.

re-PurchaseManager: Having a listener for each method is fine too. However we still need a "global" listener for example for item restores (e.g. restore of purchased items on new device). Also, the global listener will called if an item purchase completes late/user didn't wait for the purchase to complete (closing of app/network outage/battery low/etc.). Generally how the code is written now, it's pretty bare bone! It however mirrors what most IAP services provide (a "global" listener), so it would be little bit easier to implement. And then, we implement some sort of "Inventory" service on top if it. We would only would have to implement the inventory service once for all platforms. In that sense, make (a) the actual IAP code really bare but quick and easy to implement for different IAP services but then implement (b) something nice on top, e.g. some sort of fancy inventory service. Anyhow, that's just what I thought, but I can go with some else too.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 4, 2013

Hi Mario, would you mind setting the extension up? Sorry, not so sure how to do it? I won't get started today, but definitely in the near future :)

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented May 17, 2013

i'll look into setting this up asap. Just barebones projects, and integration in the build.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 21, 2013

sounds great :-D

@semtiko

This comment has been minimized.

Copy link
Contributor

semtiko commented May 21, 2013

iabhelper have some bug. There is fixed stuff - http://pastebin.com/Q3aAkdQy
And it's my iab template, works fine. Of couse it's not perfect, and not have subscription part, but it's a same, like other purchases. http://pastebin.com/vB995bp8
Maybe it's can help. Any questions.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 24, 2013

Thanks, got it :)

@jrenner

This comment has been minimized.

Copy link
Member

jrenner commented Dec 3, 2013

6 months without activity in this PR, what's the status?

@sinistersnare

This comment has been minimized.

Copy link
Contributor

sinistersnare commented Dec 3, 2013

I think this would be really cool for a 1.0.0 release, we should see what we can do

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented Dec 4, 2013

I am all up for it too :)

@EddieVanHalen98

This comment has been minimized.

Copy link

EddieVanHalen98 commented Dec 4, 2013

I'd absolutely love to see this happen

@DeveloperMCD

This comment has been minimized.

Copy link

DeveloperMCD commented Dec 21, 2013

I would love to see this integrated in LibGDX, or at least wrapped up in a way that we can use it.

@sinistersnare

This comment has been minimized.

Copy link
Contributor

sinistersnare commented Dec 22, 2013

I think that this could make a good extension, as long as we have good extension support along with our gradle-ui that is needing to be made.

@semtiko

This comment has been minimized.

Copy link
Contributor

semtiko commented Apr 30, 2014

So, year has passed and we all forgot about this "must have" extension :D Of corse someone will say "i not forgot, just very busy bla-bla-bla" )))
Maybe we will start some discussion on the forum or irc about it and start some coding? ))
Sht, i just understand - it looks like i need it, but i want someone done it for me :D No no, i really can help with android side, but need better planner than me.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 1, 2014

Yeah, I would really love to get started too! Doing it off-libGDX is doable but if it's an extension in libGDX it would get other people help contributing too. I can take care of the Desktop/iOS backend if you take care of Android. I assume you just mean Google Play. Can you do Amazon too (sales are god there too!)?

@semtiko

This comment has been minimized.

Copy link
Contributor

semtiko commented May 1, 2014

@noblemaster it's can be little bit problematic, because i have no access to Amazon developer's side as well, because they just assholes while i'm living in my crazy country. I think we need to start and will see about "enlargement".
btw, i not mean to do it off-libgdx, only like extension =)

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 1, 2014

OK, I sent a tweet to Mario - let's see :-D

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 1, 2014

Oh, by the way I realized I am an admin and could merge it into the main branch. I however think it's better to move it to an extension (rather than the main branch). Once I get the instructions from Mario how to add extensions I shall commence adding some code so everyone interested can get started to help contribute :-D

@MobiDevelop

This comment has been minimized.

Copy link
Member

MobiDevelop commented May 1, 2014

I think it definitely should be an extension. Should probably have some real discussion before committing any code though.

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented May 1, 2014

i can setup the extesnion (without any code) today if you guys tell me what
dependencies there are for each platform.
On May 1, 2014 8:06 AM, "Justin Shapcott" notifications@github.com wrote:

I think it definitely should be an extension. Should probably have some
real discussion before committing any code though.


Reply to this email directly or view it on GitHubhttps://github.com//pull/146#issuecomment-41883562
.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 1, 2014

Not sure what you need for "dependencies". Are both jar -or- Maven dependencies OK? What are you looking for? Please note, there will be several dependencies per platform (i.e. Android has more than 1 backend!):

Android - Google Play
https://developer.android.com/google/play/billing/billing_integrate.html
I believe there is only an AIDL file to add which we can take care of.

Android - Amazon:
https://developer.amazon.com/public/resources/development-tools/sdk
If you download the ZIP, there is a in-app-purchasing-1.0.3.jar. That's the one that was said to be used but haven't tried

Desktop - Stripe (that looks nice):

<dependency>
  <groupId>com.stripe</groupId>
  <artifactId>stripe-java</artifactId>
  <version>1.12.0</version>
</dependency>

https://stripe.com/docs/libraries --> go to the Java sub-section if you prefer jars.

Desktop - Steam:
I don't have Steam-access, so probably we should defer that to later.

Desktop - Apple Store
Don't have any details. Probably should defer to later as well!

iOS:
not sure. can you just setup the directory and we go from there?

@MobiDevelop: I posted some code. It's pretty bare bone. If we go this way, we can relatively quickly implement platform-specific backends (all the IAPs I checked appear to follow that same paradigm, although some IAPs offer more which however isn't compatible with all the other IAPs; e.g. downloads). What I posted is not very user friendly but a good abstraction. I was planning to add an Inventory.java (not posted) on top that is platform independent to easy list purchases/make new purchases. That Inventory.java will be the actual class people will code against.

We don't have to use what I posted. I am happy go with whatever you propose!?

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented May 1, 2014

OK, it looks that for Google Play IAP we really just need to include the
Java file generated from AIDL, that's good, no need for jar or maven
dependencies.

for amazon, it appears the jar is not available in maven central, which
sucks a little bit. not sure how to deal with that.

stripe on desktop is ok i guess and already in maven (though we also need
the jars to do the old style Ant build...)

also not sure about ios.
On May 1, 2014 1:39 PM, "Christoph Aschwanden" notifications@github.com
wrote:

Not sure what you need for "dependencies". Are both jar -or- Maven
dependencies OK? What are you looking for? Please note, there will be
several dependencies per platform (i.e. Android has more than 1 backend!):

Android - Google Play
https://developer.android.com/google/play/billing/billing_integrate.html
I believe there is only an AIDL file to add which we can take care of.

Android - Amazon:
https://developer.amazon.com/public/resources/development-tools/sdk
If you download the ZIP, there is a in-app-purchasing-1.0.3.jar. That's
the one that was said to be used but haven't tried

Desktop - Stripe (that looks nice):

com.stripe stripe-java 1.12.0

https://stripe.com/docs/libraries --> go to the Java sub-section if you
prefer jars.

Desktop - Steam:
I don't have Steam-access, so probably we should defer that to later.

iOS:
not sure. can you just setup the directory and we go from there?

@MobiDevelop https://github.com/MobiDevelop: I posted some code. It's
pretty bare bone. If we go this way, we can relatively quickly implement
platform-specific backends (all the IAPs I checked appear to follow that
same paradigm, although some IAPs offer more which however isn't compatible
with all the other IAPs; e.g. downloads). What I posted is not very user
friendly but a good abstraction. I was planning to add an Inventory.java
(not posted) on top that is platform independent to easy list
purchases/make new purchases. That Inventory.java will be the actual class
people will code against.

We don't have to use what I posted. I am happy go with whatever you
propose!?


Reply to this email directly or view it on GitHubhttps://github.com//pull/146#issuecomment-41901579
.

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 1, 2014

We can defer Amazon to later if that's a problem. I can send an email to Amazon and ask them if they were willing to help us out with Maven. They can't refuse the libGDX :)

@badlogic

This comment has been minimized.

Copy link
Member

badlogic commented May 1, 2014

sounds good :)
On May 1, 2014 1:55 PM, "Christoph Aschwanden" notifications@github.com
wrote:

We can defer Amazon to later if that's a problem. I can send an email to
Amazon and ask them if they were willing to help us out with Maven. They
can't refuse the libGDX :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/146#issuecomment-41902904
.

@semtiko

This comment has been minimized.

Copy link
Contributor

semtiko commented May 1, 2014

What we will get finally? - gdx-iab (core, just interfaces), gdx-iab-android, gdx-iab-desktop... ?

@just4phil

This comment has been minimized.

Copy link

just4phil commented May 1, 2014

what about ouya?
i implemented IAP for my ouya game ... maybe i can try to contribute...

@semtiko

This comment has been minimized.

Copy link
Contributor

semtiko commented May 1, 2014

As i know ouya need only ouyasdk.jar?

@just4phil

This comment has been minimized.

Copy link

just4phil commented May 1, 2014

yes i integrated ouya-sdk.jar

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 1, 2014

Yes, Ouya would be nice to have as well :)

@MobiDevelop

This comment has been minimized.

Copy link
Member

MobiDevelop commented May 1, 2014

I have implemented a generic purchasing api with Amazon and Google Play backends. I cannot contribute that directly as it was for my former employer; however, I can contribute with other code/ideas. I'll take a look at all of this later today.

@littletinman

This comment has been minimized.

Copy link

littletinman commented May 5, 2014

I would love to see a complete example or a walk through for integrating the ouya.sdk.jar with a libgdx project because this does not seem straightforward to me based on my limited knowledge of anything Java aside from Libgdx stuff!

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented May 7, 2014

I messaged Amazon. That's the response I got back:

Thank you for your patience. We have discussed your request with the IAP team and the task to publish it would fall on them to complete. However, unfortunately we cannot commit to a time as to when it would be published and available for use within the Maven repository.

I guess there is no time if/when they will do it. At least we let them know. I'll assume they'll eventually do it. We'll see.

@badlogic badlogic added the enhancement label May 8, 2014
@FredGithub

This comment has been minimized.

Copy link
Contributor

FredGithub commented Jun 2, 2014

Can't wait to see this extension setup so we can start contributing!

Also nobody mentionned html backend, but I think it would be possible (and also awesome) to include Facebook Payments!

@noblemaster

This comment has been minimized.

Copy link
Member Author

noblemaster commented Jun 8, 2014

I have converted this draft into an extension. I changed some stuff around & tried to simplify. Please continue the discussion here: #1946

@noblemaster noblemaster closed this Jun 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.