D1Task
public class D1Task
Main class for D1 SDK use cases.
Note
It is recommended to initialize D1Task as soon as the application is
launched or the earliest possible time.
Since
1.0.0
-
A function to return the SDK version of
D1and its internal dependencies.Declaration
Swift
public static func getSDKVersions() -> [String : String]Return Value
A list of SDK versions.
-
D1 Task configurations. It is the entry point for SDK initialization. App can only initialize certain features to reduce waiting time. It is not mandatory to initialize all features in a single call.
Declaration
Swift
public func configure(_ configParams: Set<ConfigParams>, completion: @escaping ([D1Error]?) -> Void)Parameters
configParamsconfigurations
completionThe callback is invoked when the configuration is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Login to the D1 services using the token provided.
Declaration
Swift
public func login(_ issuerToken: inout Data, completion: @escaping (D1Error?) -> Void)Parameters
issuerTokenIsssuer token used to login to the D1 services.
completionThe callback is invoked when the login process is completed. Possible errors:
-
Logout from the D1 services.
Declaration
Swift
public func logout(_ completion: @escaping (D1Error?) -> Void)Parameters
completionThe callback is invoked when the logout process is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Retrieve application instance identifier. Possible errors: -
D1Error.Code.coreSince
3.0.0Declaration
Swift
public static func appInstanceID() throws -> String -
Reset the SDK. Calling this API will delete all the SDK internal data and the end user wll need to initialize and re-enroll to the SDK services.
Since
3.0.0Declaration
Swift
public static func reset() -
Retrieves the basic card metadata. Use this API to retrieve last 4 PAN digits value and Card Art.
Declaration
Swift
public func cardMetadata(_ cardID: String, completion: @escaping (CardMetadata?, D1Error?) -> Void)Parameters
cardIDThe card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, the card metadata will be returned. Otherwise, the error details will be returned. Possible errors:
-
Retrieves the CardDetails information. Use this API to retrieve Full Card Information, including full PAN value. These values can be used for online transaction.
Declaration
Swift
public func cardDetails(_ cardID: String, completion: @escaping (CardDetails?, D1Error?) -> Void)Parameters
cardIDThe card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, the card details info will be returned. Otherwise, the error details will be returned. Possible errors:
-
Displays Card Details information securely.
Use this API to display full card information. Through the UI component in
CardDetailsUI, the API sets the CardDetails information in the UI. Integrator has full control of the UI appearance and layout.Since
2.1.0
Declaration
Swift
public func displayCardDetails(_ cardID: String, cardDetailsUI ui: CardDetailsUI, completion: @escaping (D1Error?) -> Void)Parameters
cardIDCard identifier.
cardDetailsUIThe UI to display card details.
completionThe callback invoked when the operation is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Displays the PIN of the physical card . Use this API to retrieve the PIN attached to a physical card in a secure way.
Since
1.1.0Declaration
Parameters
cardIDThe card identifier.
cardPINUIThe UI to display the PIN of the physical card.
completionThe callback is invoked when the operation is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Sets the PIN of a physical card. Change physical card PIN. This function should be called at the start of UI display. SDK manage the UI entry capture securely and return events through PINEntryUIDelegate.
Since
3.3.0Declaration
Swift
public func changePIN(_ cardID: String, textFieldNew: D1SecureTextField, textFieldConfirm: D1SecureTextField, options: ChangePINOptions, delegate: PINEntryUIDelegate) throws -> PINEntryUI?Parameters
cardIDThe card identifier.
textFieldNewThe new PIN entry field.
textFieldConfirmThe confirm PIN entry field.
optionsThe PIN entry option.
delegatePINEntryUIDelegate, possible events: pinMismatch, pinMatch, firstEntry Possible errors:
Return Value
PINEntryUIinstance, the UI to trigger wipe or submit functionality. -
Retrieves the activation method for a physical card. This API identifies the activation method to be used for activating a physical card.
Since
1.1.0Declaration
Swift
public func cardActivationMethod(_ cardID: String, completion: @escaping (CardActivationMethod?, D1Error?) -> Void)Parameters
cardIDThe card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, it returns the
CardActivationMethodas result. Otherwise, the error details will be returned. Possible errors: -
Activates a physical card. Use this API to activate a physical card for usage.
Since
1.1.0Declaration
Parameters
cardIDThe card identifier.
entryUIThe UI to display secure text entry. If
activationMethodisCardActivationMethodNothing, constructEntryUIwith the value inD1SecureTextFieldset to ‘nil’.completionThe callback is invoked when the operation is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Activates a digital card. Use this API to activate a digital card for usage.
Since
3.2.0Declaration
Swift
public func activateDigitalCard(withDigitalCardID digitalCardID: String, completion: @escaping (D1Error?) -> Void)Parameters
digitalCardIDThe digital card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Update the new push notification token.
Since
3.0.0Declaration
Swift
public func updatePushToken(_ token: String, completion: @escaping (D1Error?) -> Void)Parameters
tokenThe latest push notification token.
completionThe callback invoked when the operation is completed. When it succeeds, it returns no error. Otherwise, it returns the error details. Possible errors:
-
Process the push notification data received from the notification server.
Since
3.0.0Declaration
Swift
public func processNotification(_ notification: [String: Any], completion: @escaping ([PushResponse.Key: String]?, D1Error?) -> Void)Parameters
dataThe push notification payload
completionThe callback invoked when the operation is completed. Returns the push notification content. Check
PushResponse.Key.messageTypeto identify message type. Possible errors: -
Checks the card digitization details. Use this API to determine if we need to show ‘Add to Apple Pay’, ‘Activate on your phone’, ‘Activate on your watch’ button on the application.
Note
This API contains PKPassLibrary. It is not thread-safe. Use the instances of this class only on a single thread.
Declaration
Swift
public func cardDigitizationState(_ cardID: String, completion: @escaping (CardDigitizationResult?, D1Error?) -> Void)Parameters
cardIDThe card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, it returns the
CardDigitizationResultmethod. Otherwise, the error details will be returned. Possible errors: -
Add digital card to OEM wallet for a given cardID for Apple Pay
Note
This API contains PKPassLibrary. It is not thread-safe. Use the instances of this class only on a single thread.
Declaration
Swift
public func addDigitalCardToOEM(_ cardID: String, viewController: UIViewController, completion: @escaping (D1Error?) -> Void)Parameters
cardIDThe card identifier.
viewControllerThe current view controller to present the add card process.
completionThe callback is invoked when the operation is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Activates the digital card that has the value of
CardDigitizationStateequal toCardDigitizationState.pendingIDVLocalorCardDigitizationState.pendingIDVRemote.Note
This API contains PKPassLibrary. It is not thread-safe. Use the instances of this class only on a single thread.
Declaration
Swift
public func activateDigitalCard(_ cardID: String, completion: @escaping (D1Error?) -> Void)Parameters
cardIDThe card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, no error will be returned. Otherwise, the error details will be returned. Possible errors:
-
Get the digital card for serial number provided by ApplePay.
Note
This API contains PKPassLibrary. It is not thread-safe. Use the instances of this class only on a single thread.
Since
3.2.0
Declaration
Swift
public func digitalCardPass(forSerialNumber serialNumber: String) throws -> PKPass?Parameters
serialNumberThe serial number provided by ApplePay.
Return Value
PKPassinstance. -
Retrieves the digital card list for a given cardID.
Note
EachDigitalCardprovides the methodDigitalCard.isOnCurrentDeviceto identify if the digital cards are on the device (only for Apple Pay).Warning
This method requires
D1Taskto be configured first by callingD1Task.configure(_:completion:)withConfigParams.cardConfig(). Otherwise,NSInvalidArgumentException` will be thrown.Declaration
Swift
public func digitalCardList(_ cardID: String, completion: @escaping ([DigitalCard]?, D1Error?) -> Void)Parameters
cardIDThe card identifier.
completionThe callback is invoked when the operation is completed. When the callback is successful, it returns the list of digital cards. Otherwise, the error details will be returned. Possible errors:
-
Updates the digital card status for a given digital cardID. The following
CardActioncan be performed:- Activates the card
- Suspends the card
- Deletes the card
Declaration
Swift
public func updateDigitalCard(_ cardID: String, digitalCard: DigitalCard, action: CardAction, completion: @escaping (Bool, D1Error?) -> Void)Parameters
cardIDThe card identifier.
digitalCardThe digital card details.
actionThe card action to be performed: active, suspend or delete.
completionThe callback is invoked when the operation is completed. When the callback is successful, it returns the operation status. Otherwise, the error details will be returned. Possible errors:
-
Retrieves the eligible token requestor list for a given cardID.
Warning
This method requires
D1Taskto be configured first by callingD1Task.configure(_:completion:)withConfigParams.cardConfig(). Otherwise,NSInvalidArgumentException` will be thrown.Declaration
Swift
public func tokenRequestorList(_ cardID: String, completion: @escaping ([TokenRequestor]?, D1Error?) -> Void)Parameters
cardIDThe card identifier from
D1Task.consumerDetails(_:)API.completionThe callback is invoked when the operation is completed. When the callback is successful, it returns the token requestor list. Otherwise, the error details will be returned. Possible errors:
-
Adds a digital card to scheme for a given cardID.
Warning
This method requires
D1Taskto be configured first by callingD1Task.configure(_:completion:)withConfigParams.cardConfig(). Otherwise,NSInvalidArgumentExceptionwill be thrown.Declaration
Swift
public func addDigitalCardToScheme(_ cardID: String, tokenRequestor: TokenRequestor, appURL: String, termsAndConditionsAccepted: Bool, completion: @escaping (String?, D1Error?) -> Void)Parameters
cardIDThe card identifier.
tokenRequestorThe target token requestor that the end user has selected.
appURLYour app’s custom URL scheme that the token requestor calls back upon the completion of tokenization flow to redirect the end user back to the initial page.
termsAndConditionsAcceptedTerms and conditions accepted by the end user. This is only applicable for Visa card scheme. The value is set by the issuer to indicate to the token requestor whether the customer has already accepted the issuer’s terms and conditions. This is required for Secure Remote Commerce service. If the value is
true, the token requestor can suppress the display of the terms and conditions to the customer and submit the terms and conditions GUID to Visa as though the customer has already accepted the them.completionThe callback is invoked when the operation is completed. When the callback is successful, it returns the push provisioning URL String. Otherwise, the error details will be returned. The push provisioning URL String is used to open and pass the information the Token Requestor app. Possible errors:
-
return an instance of SecureLog object to allow changing log level, getting/deleting log files.
Declaration
Swift
public func secureLog() -> SecureLog? -
Get
D1PushToECommerceinstance to access scheme push provisioning API methods.Since
3.3.0Declaration
Swift
public func d1PushToECommerce() -> D1PushToECommerceReturn Value
D1PushToECommerceinstance. -
Retrieve D1Authn object for Authn use cases
Since
3.0.0Declaration
Swift
public func d1Authn(_ authnDelegate: AuthnDelegate) -> D1Authn?Parameters
authnDelegatedelegate for authn use cases
D1Task Class Reference