2

I am creating an Android application that will offer users a subscription option if the user has his credit card information stored in their device. If he does not, I am thinking about offering different methods for the user to use the application.

Does anyone know if there is a way to check if a user has his credit card information stored in their device?

To clarify what I am looking for:

Android devices allow users to store credit card information so they don't have to re-enter the information for every purchase. I'm talking about identifying that the user has that data stored. I am not talking about storing that information myself for the user or trying to get it. All I need is a boolean method that will tell me if the user has the data stored or something similar.

Rene Argento
  • 53
  • 1
  • 8
  • 4
    That question is as `SCARY` as it can be – Hanky Panky Aug 20 '13 at 15:26
  • What do you mean by "credit card information stored in the device"? Where "in the device"? P.S. And I'm not even talking about security implications. – Aleks G Aug 20 '13 at 15:26
  • 1
    There's this thing called privacy... – Dennisch Aug 20 '13 at 15:28
  • no experiense in this topic but , its insecured to have those data in device and they should be stored at the server . – Srinath Ganesh Aug 20 '13 at 15:29
  • The user will think you're scamming him/her – Niko Adrianus Yuwono Aug 20 '13 at 15:30
  • 1
    Android devices allow users to store credit card information so they don't have to re-enter the information for every purchase. I'm talking about identifying that the user has that data stored. Basically, a boolean method would work perfectly. – Rene Argento Aug 20 '13 at 15:30
  • I wish any of these people understood the purpose of your question... I too would like to know *if* the user has payment details on the play store, not *what* it is. I suspect that just asking for authorization of $0.01 would do it, but that's such a stupid hack. – anthropic android Mar 09 '14 at 01:11

1 Answers1

1

Credit Card information isn't really stored "on the device." In the case of devices that are connected to the Play Store, Google account credentials are stored and payments are made through Google Wallet. I don't have a lot of experience with other types of devices, but I imagine they all work in a similar fashion, for example a Kindle Fire will keep Amazon account credentials, etc.

If you're looking to create an application that provides in-app purchases and will be available on the Play Store, you can click here to read about Google's In-App Billing API that allows your users to use their Google Wallet to make payments. For Kindle Devices, Amazon has a similar API.

It would be a pretty major security concern if arbitrary apps had access to the device owner's credit card information. If you're writing an app that you intend to distribute outside of a reputable app store and therefore without a built-in in-app purchase api, you're going to have to use your own payment mechanism. If this is the case, I wouldn't recommend creating your own. I believe PayPal has an Android API, and a quick Google search came up with a few other less notable brands that offer this service, though if you do intend to use the Play Store or Amazon's app store, using a 3rd party payment API usually goes against their terms of service.

Edit: The AccountManager class allows you to view info about accounts on the device, however, I don't believe that you can use it to discover if the user has a payment method set up through Google Wallet. I found this SO question that goes into detail about what the AccountManager can be used for. If this is a Play Store app, I'd look into the Google In-App Billing API, it's probably the best option for what you're trying to do.

Community
  • 1
  • 1
MattDavis
  • 5,158
  • 2
  • 23
  • 35
  • Thank you for the information. I already have an application on Play Store that offers users a subscription option. A better question in this case would be: Is there a way to check if the user has his Google account credentials stored in the device? – Rene Argento Aug 20 '13 at 15:59