Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the transaction history from Android Pay via API?

Our application (an expenses manager) would like to extract the transaction history from Android Pay in order to make it easier for the user to enter their purchase history. Is this possible - either through an Android app on the same phone where the purchases were made or through an external API?

I've found plenty of information on how to integrate Android Pay payments from within the app, but nothing on how to access the previous transactions.

like image 421
JonathanReez Avatar asked Jun 17 '17 13:06

JonathanReez


People also ask

What is API payment?

What is a payment API? A payment API is an API (application programming interface) that enables ecommerce businesses to seamlessly manage payments. Payment APIs have the power to optimize the payments process for both businesses and shoppers, as they can make transactions faster and more secure.


1 Answers

Unfortunately, it looks like this is not possible via any API at this moment. It is probably made for security purposes.

The only way to view the transaction history is by:

  • Opening the Android Pay app.
  • Touching the card you used to pay.

But there might be a workaround, though remember that you are responsible for your actions.

  • Create an AccessibilityService
  • Subscribe for AccessibilityEvent (for example focus on element) using onAccessibilityEvent()
  • Advice user to enable your service in Settings and open the Android Pay app.
  • Get focused element's text using getText() method of an AccessibilityEvent
  • Pass it to your activity using an Intent
like image 180
u32i64 Avatar answered Sep 30 '22 09:09

u32i64