tomavic / cordova-apple-wallet

A Cordova plugin that provides easy use for adding your credit/debit cards to Apple Wallet. It also can check if the credit/debit card exists in Wallet or any paired device e.g. Apple Watch
Apache License 2.0
43 stars 52 forks source link

Deep Linking from Wallet to Cordova app and then calling back Apple Wallet to le tknow its good/bad #13

Open fortivait opened 4 years ago

fortivait commented 4 years ago

Hi, Is there method available to call back to Apple wallet to let know the card in wallet is good/bad to complete activation of card ? Using plugin to check wallet is there and checkPairedDeviceyBySuffix to make sure cards are matching.. need next method to complete activation in wallet

Appreciate help

Cheers

fortivait commented 4 years ago

Also would it be possible to add this method to plugin Get the list of payment passes on Apple Wallet on iPhone • passes(of:) • PKPassType.payment

tomavic commented 4 years ago

Hi @fortivait

Currently you can check if a certain card is in wallet or not, then you have the option to add it or not based on if it exist or not

faugusztin commented 4 years ago

What @fortivait mentions is a valid enhancement request, as adding the card via wallet and getting all the way to the final callback doesn't necessarily mean that the card is usable, also there is no way right now to get the primaryAccountIdentifier back to JS code.

It would be good to have an plugin method, which returns the result of NSArray<PKPass *> *paymentPasses = [passLibrary passesOfType:PKPassTypePayment]; (and other respective lists from other API methods as needed) as a array of objects with properties from the pass to use in the JS code - including the activationState (which can be Activated, Activating, Deactivated, RequiresActivation, Suspended).

faugusztin commented 4 years ago

@fortivait If the card goes through the startAddPaymentPass and completeAddPaymentPass methods, the card is added to Apple Wallet and further activation steps are not part of PassLibrary API. There is no 'completion' API to be added.

The only extra thing which could be added to plugin is a method to get the activation state of the card, or a method to return the whole PKPass object (or array of them), obviously transformed to a JSON-like object. That way you could check what is the current state of said card.

fortivait commented 4 years ago

The use case we were trying to build was for Issuer Flow... Start in Wallet and when there is Step up Transition to App, when App Launches need to query Wallet for this ListOfPaymentPasses is needed, internal check validate PaymentPass belongs to Customer Logged in to App then get OTP Token from network provider and call below below[activateSecureElementPass] to Complete Activation.. activateSecureElementPass:withActivationData:completion: https://developer.apple.com/documentation/passkit/pkpasslibrary/3543451-activatesecureelementpass?language=objc

faugusztin commented 4 years ago

The plugin right now implements only in-app provisioning flow (starts in app, goes to wallet), what you described is the in-app verification flow (starts in wallet, goes to app). Indeed, the in-app verification flow requires implementation of activatePaymentPass (or activateSecureElementPass) method.

Unfortunately that method is not implemented yet in this plugin.

Qu1lby commented 3 years ago

Hi everybody, is there any way the in-app verification flow would be implemented on this plugin ? Or do you know any way we could have this feature on another plugin ? Thanks !

thib-lambert commented 1 week ago

You can try to use this SDK and the method getActionsAvailableForCardSuffix. This method returns an array of integer so you have 3 cases:

You can also use openCard method.