Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application not visible in Tap and Pay

What is the key thing to adjust in NFC HCE application to get it visible under settings NFC Tap and Pay

Following code returns true for the app, so it's capable of payment:

boolean isDefault = CardEmulation
                .getInstance(NfcAdapter.getDefaultAdapter(this))
                .isDefaultServiceForCategory(
                        new ComponentName(this, MyPaymentService.class),
                        CardEmulation.CATEGORY_PAYMENT);

Service declaration in manifest:

<service
    android:name="my.package.MyPaymentService"
    android:exported="true"
    android:permission="android.permission.BIND_NFC_SERVICE" >
    <intent-filter>
        <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />

        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>

    <meta-data
        android:name="android.nfc.cardemulation.host_apdu_service"
        android:resource="@xml/apduservice" />
</service>

apduservice:

<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
    android:requireDeviceUnlock="true" >

    <aid-group
        android:category="payment"
        android:description="@string/paymentGroup" >
        <aid-filter
            android:name="325041592E5359532E4444463031"
            android:description="@string/ppse" />
        <aid-filter
            android:name="A0000000041010"
            android:description="@string/mastercard" />
        <aid-filter
            android:name="A0000000031010"
            android:description="@string/visa" />
        <aid-filter
            android:name="A000000003101001"
            android:description="@string/visa" />
        <aid-filter
            android:name="A0000002771010"
            android:description="@string/interac" />
    </aid-group>

</host-apdu-service>

I'm missing something but not sure what and where to put it.

Thanks.

like image 545
Niko Avatar asked Jun 09 '14 10:06

Niko


People also ask

Why isn't my tap card available in the tap app?

TAP cards registered under group programs are not currently included in the TAP app due to privacy restrictions that prohibit someone else from managing a TAP card on your phone. Group programs include, A/B TAP, UPass, EPass and S TAP. TAP is working on including these programs in a future release of the app. 19.

Can I use tap to pay on my iPhone?

Tap to Payon iPhone Payment apps can now accept contactless payments from contactless credit or debit cards, Apple Pay,Apple Watch,and smartphones with other digital wallets — right on iPhone and without any extra terminals or hardware.1

How do I Know my Fare has been accepted on tap?

Hold the top of your phone or the display of your watch within a few inches of the TAP dial. You will feel a vibration and see “Done” and a checkmark on the display to confirm your fare has been accepted. 7. How do I add a credit/debit card to my TAP account using the TAP app?

How do I Manage my plastics TAP cards?

Plastic TAP cards are registered to your TAP account. You can manage your cards in the TAP app, and then tap and pay with your plastic cards. TAP cards added using the TAP app are also registered and can be managed through the TAP app. However, this card allows you to tap and pay with your phone.


1 Answers

In order to be shown in the tap-and-pay menu, a HCE app must provide a banner graphic. You would include the graphic into the host-apdu-service XML using the android:apduServiceBanner attribute:

<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
    android:requireDeviceUnlock="true"
    android:apduServiceBanner="@drawable/servicebanner">

    <aid-group android:category="payment"
               android:description="@string/paymentGroup" >
        <aid-filter ... />
    </aid-group>
</host-apdu-service>

The service banner should be a graphic file (e.g. a .png file) with dimensions of 260 x 96 pixels.

like image 163
Michael Roland Avatar answered Sep 21 '22 14:09

Michael Roland