Interface PaymentPasskeyService
Payment Passkey provides secure device-binding functionality for card transactions, enabling end users to authenticate payments using their device credentials.
Integration requirements:
- Do not allow the
Activityused by a Payment Passkey API to change state while the API is executing. For example, to prevent configuration changes such as device rotation from recreating the Activity until the operation has completed. - Execute the Payment Passkey API methods one at a time. Wait for an operation to complete
before invoking another API method.
handleResult(Intent)is excluded from this restriction.
- Since:
- 4.5.0
-
Method Summary
Modifier and TypeMethodDescriptioncreate(String cardId, ConsumerInfo consumerInfo, TermsAndConditions termsAndConditions, Activity activity) Creates a Payment Passkey for the specified card.create(String cardId, ConsumerInfo consumerInfo, String language, Activity activity) Creates a payment passkey for the specified card.getPaymentPasskeyList(String cardId, String language, Activity activity) Retrieves the list of payment passkeys (device bindings) associated with the specified card.voidhandleResult(Intent intent) Handles the result from the browser or activity callback after Payment Passkey enrollment.
-
Method Details
-
handleResult
Handles the result from the browser or activity callback after Payment Passkey enrollment.This method should be called from the Activity's
onNewIntent()or similar lifecycle method to process the redirect URL containing enrollment status and session information.Note: This method may be called while another Payment Passkey API operation is in progress.
- Parameters:
intent- The `Intent` containing the result data from a browser/custom tab.- Since:
- 4.5.0
-
getPaymentPasskeyList
Task<List<PaymentPasskey>> getPaymentPasskeyList(@NonNull String cardId, @NonNull String language, @NonNull Activity activity) Retrieves the list of payment passkeys (device bindings) associated with the specified card.This API returns all payment passkey bindings for the card, including the devices they are bound to and their current status. If no valid session exists, this method will automatically initiate the session creation flow via a browser/custom tab.
Note: Do not change the state of
activity, for example by rotating the device, while this method is executing. Do not invoke this method while another Payment Passkey API operation is in progress.- Parameters:
cardId- The card identifier.language- The preferred language for localized content. Format: A 2-letter language code (ISO 639-1) in lowercase with a hyphen ("-"), followed by a 2-letter (ISO 3166-1 alpha-2) country code in uppercase. For example: en-USactivity- The Android Activity used to launch browser/UI components when session creation is needed.- Returns:
- A
Taskthat returns aListofPaymentPasskeyobjects.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUNDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_INVALID_ARGUMENTD1Exception.ErrorCode.ERROR_CARD_OPERATION_NOT_ALLOWEDD1Exception.ErrorCode.ERROR_PAYMENT_PASSKEYD1Exception.ErrorCode.ERROR_PAYMENT_PASSKEY_UNKNOWN_SESSIOND1Exception.ErrorCode.ERROR_SERVER
- Since:
- 4.5.0
-
create
Task<PaymentPasskey> create(@NonNull String cardId, @NonNull ConsumerInfo consumerInfo, @NonNull TermsAndConditions termsAndConditions, @NonNull Activity activity) Creates a Payment Passkey for the specified card.This method initiates the Payment Passkey creation process by launching a Chrome Custom Tab for user authentication. Currently, this serivce is supported for Mastercard and Visa cards only.
Important: This method must be called in sequence with
handleResult(Intent). The returned `Task` will wait for the callback URL to be received and processed byhandleResult(). Ifcreate()is called repeatedly without the previous operation completing, the `Task` execution will throw aD1Exceptionwith error codeERROR_PAYMENT_PASSKEYand message"PAYMENT_PASSKEY_IN_PROGRESS".- Parameters:
cardId- The ID of the card for which to create the Payment PasskeyconsumerInfo- The consumer information such as email, phone number, and language. For Mastercard, at least an email address or phone number must be provided.termsAndConditions- This is mandatory for Mastercard.activity- The activity context used to launch the authentication flow.- Returns:
- A `Task` that returns the created
PaymentPasskeyon success.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUNDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_INVALID_ARGUMENTD1Exception.ErrorCode.ERROR_CARD_OPERATION_NOT_ALLOWEDD1Exception.ErrorCode.ERROR_PAYMENT_PASSKEYD1Exception.ErrorCode.ERROR_PAYMENT_PASSKEY_UNKNOWN_SESSIOND1Exception.ErrorCode.ERROR_PAYMENT_PASSKEY_CREDENTIAL_EXISTD1Exception.ErrorCode.ERROR_SERVER
- Since:
- 4.5.0
-
create
Task<PaymentPasskey> create(@NonNull String cardId, @NonNull ConsumerInfo consumerInfo, @NonNull String language, @NonNull Activity activity) Creates a payment passkey for the specified card.This method initiates the Payment Passkey creation process by launching a Chrome Custom Tab for user authentication. Currently, this service is supported for Mastercard and Visa cards only.
Important: This method must be called in sequence with
handleResult(Intent). The returned `Task` will wait for the callback URL to be received and processed byhandleResult(). Ifcreate()is called repeatedly without the previous operation completing, the Task execution will throw aD1Exceptionwith error codeERROR_PAYMENT_PASSKEYand message"PAYMENT_PASSKEY_IN_PROGRESS".- Parameters:
cardId- The ID of the card for which to create the Payment PasskeyconsumerInfo- The consumer information such as email, phone number, and language. For Mastercard, at least an email address or phone number must be provided.language- This is mandatory for Mastercard and Visa.activity- The activity context used to launch the authentication flow.- Returns:
- A `Task` that returns the created
PaymentPasskeyon success.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUNDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_INVALID_ARGUMENTD1Exception.ErrorCode.ERROR_CARD_OPERATION_NOT_ALLOWEDD1Exception.ErrorCode.ERROR_PAYMENT_PASSKEYD1Exception.ErrorCode.ERROR_PAYMENT_PASSKEY_UNKNOWN_SESSIOND1Exception.ErrorCode.ERROR_PAYMENT_PASSKEY_CREDENTIAL_EXISTD1Exception.ErrorCode.ERROR_SERVER
- Since:
- 4.5.0
-