Search code examples
nfcapplepay

How to get the merchant, where a NFC-enabled pass is used?


I want to create a NFC-enabled pass for ApplePay. My problem ist I dont know how I get the merchent the pass was used and how can I configure which mergents are allowed.

The idea is: - User gets our loyality card - User goes into the store and pays with ApplePay - I get information were the user pays to manage loyality points

But I can' find a way in the documentation were I can define allowed stores, or how I get an feedback about buying something on a store.

I think this is the important part of the documentation:

The NFC-enabled pass will not function without a terminal compatible with the Apple value added services protocol. Each NFC-enabled pass contains a 64-byte data element which can identify a customer. This data element can represent a rewards card for a loyalty program, a stored value card, or a ticket. Apple Wallet only transmits this data element to an NFC-enabled terminal that is compatible with the Apple value added services protocol.



NFC-Enabled Pass Keys

NFC-enabled pass keys support sending reward card information as part of an Apple Pay transaction.

Important: NFC-enabled pass keys are only supported in passes that contain an Enhanced Passbook/NFC certificate. For more information, contact merchant support at https://developer.apple.com/contact/passkit/.



Passes can send reward card information to a terminal as part of an Apple Pay transaction. This feature requires a payment terminal that supports NFC-entitled passes. Specifically, the terminal must implement the Value Added Services Protocol.

Passes provide the required information using the nfc key. The value of this key is a dictionary containing the keys described in NFC Dictionary Keys. This functionality allows passes to act as the user’s credentials in the context of the NFC Value Added Service Protocol. It is available only for storeCard style passes.

Key name     Type                   Description

nfc           nfc dictionary        Optional. Information used for Value Added 
                                    Service Protocol transactions. For 
                                    this dictionary’s keys, see 
                                    NFC Dictionary Keys.

Available in iOS 9.0.





NFC Dictionary Keys

Information about the NFC payload passed to an Apple Pay terminal.

Key name    Type        Description

message     string      Required. The payload to be transmitted to the Apple 
                        Pay terminal. Must be 64 bytes or less. Messages 
                        longer than 64 bytes are truncated by the system.

encryptionPublicKey string   Optional. The public encryption key used by the 
                             Value Added Services protocol. Use a Base64 
                             encoded X.509 SubjectPublicKeyInfo structure 
                             containing a ECDH public key for group P256.

But as I can see there is only a possibility to give a message, but not to define a merchant or to define a callback.

How will I know where the card is used? How can i define which merchants are allowed?

Thanks


Solution

  • It is not possible to determine when an ApplePay card is used other than from the terminal provider itself. You would need to have a NFC-enabled loyalty pass in the users wallet and use a VAS enabled NFC reader to read the relevant user data, then you would have application logic in your terminal to determine where the pass was used.

    At PassNinja, we provide readers and an SDK that can read GPay and Apple Pay loyalty passes.