I have made an Host APDU Service that listens on 2PAY.SYS.DDF01 message. Then it sends loyalty card details to the payment terminal.
Here is my AID filter:
<aid-group android:description="@string/aiddescription"
android:category="payment">
<aid-filter android:name="325041592E5359532E4444463031"/>
<aid-filter android:name="A0000003790000"/>
</aid-group>
My service listens to AID: 325041592E5359532E4444463031, then it sends loyalty card AID and the payment terminal selects loyalty card. Then my app transfers all the data.
The problem is that my app has to be selected for default Tap to Pay app instead of Google Pay. Is there any way to come around this? Or can I send my loyalty card data automatically when payment terminal is detected and the terminal could choose it, if it wants?
If I understood this presentation correctly I could tell Google Pay that I have my own payment service and Google Pay could tell the payment terminal all possible payment AIDs: https://www.slideshare.net/NFC-Forum/android-hce-an-intro-into-the-world-of-nfc-presentation-by-neel-rao-of-google-at-andevcon-2014-andevcon-android-app-developers-hce-nfc-tech-technologyan-devcon-presentation