3DSの初期化
最終更新
役に立ちましたか?
役に立ちましたか?
AuthnCallback authnCallback = new AuthnCallback() {
@Override
public void onTransactionDataConfirmation(@NonNull Map<String, String> map, @NonNull AuthnUserConfirmationCallback authnUserConfirmationCallback) {
// Compose transaction details message using JSON payload received.
String message = "";
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(activity)
.setTitle("Transaction Details")
.setMessage(message)
.setPositiveButton("OK", (dialog, which) -> {
authnUserConfirmationCallback.proceed();
dialog.dismiss();
}).setNegativeButton("Cancel", (dialog, which) -> {
authnUserConfirmationCallback.cancel();
dialog.dismiss();
});
android.app.AlertDialog alertDialog = builder.create();
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
}
@NonNull
@Override
public String onBiometricPromptMessage() {
return <Message to be displayed to the user during biometric prompt>
}
};
D1Authn d1Authn = d1Task.getD1Authn(activity, authnCallback);extension ViewController: AuthnDelegate {
public func authn(_ authn: D1Authn, shouldConfirmTransactionData transactionData: [String : String], proceedHandler: (@escaping() -> Void), cancelHandler: (@escaping() -> Void)) {
// Compose transaction details message using JSON payload received.
var message = ""
// Display the transaction details message to the end user, with the option to proceed or cancel.
let alertController = UIAlertController(title: "Transaction Details", message: message, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Proceed", style: .default, handler: { action in
proceedHandler()
}))
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: {action in
cancelHandler()
}))
present(alertController, animated: true)
}
public func authnTouchIDOperationPrompt(_ authn: D1Authn) -> String {
return <Message to be displayed to the user during Touch ID verification>
}
}
let d1Authn = d1Task.d1Authn(self)