注記:このAPIはプレビューのみを目的としており、変更される可能性があります。
デバイスデータ収集
注文や取引の詳細と組み合わせると、デバイスデータ(IPアドレス、デバイスID、ジオロケーション情報など)は不正の強力な指標になるか、GeoIPルックアップを介してロケーションに基づいて手動ルールを作成する際に使用することができます。Access FraudSightでデバイスデータを利用するには2段階のプロセスを経なければなりません。手順1は、デバイスデータを収集することです。手順2は、デバイスデータを使用する
ThreatMetrix iOS SDK
ThreatMetrix iOS SDKは、モバイルアプリケーション開発者にiOS固有のライブラリを提供します。ThreatMetrixプラットフォームを活用して、モバイルデバイスに起因する不正やセキュリティの脆弱性をリアルタイムで検出します。
この手順は、ThreatMetrix SDKバージョンV6-2に適用されます。
実装
アプリケーションにプロファイリング用のThreatMetrixSDKモジュールを含めます。
initProfile()
方法を呼び出してSDKを初期化します。doProfile()
方法を呼び出して、デバイスのプロファイリングを開始します。ThreatMetrix SDKは、収集された属性と一意のsessionIdをThreatMetrixプラットフォームに送信します。FraudSight評価リクエストに
sessionId
を適用します。(リスク評価の一部となるために)
SDKの入手方法
注記:これはまもなくリリースされます。このドキュメントはプレビュー専用です。
含めるモジュール
TMXProfiling: このモジュールは、プロファイリングを排他的に実行します。ネットワークを介して何も転送しないため、モジュールはそれ自体でデータを送受信しません。プロファイリングを成功させるには、このモジュールをTMXProfilingConnectionsモジュールまたはカスタムプロファイリング接続モジュールとペアにして、バックエンドとの間でデータを送受信する必要があります。
TMXProfilingConnections: これは、ThreatMetrixが提供するデフォルトのネットワークモジュールです。このモジュールは、データを変更せずにネットワーク経由でのみデータを転送します。
TMXProfilingおよびTMXProfilingConnectionsモジュールの.dmgファイルをダウンロードし、それらを抽出して.xcframeworkファイルを取得します。
.xcframeworkファイルを依存関係としてアプリケーションディレクトリにコピーします。
ThreatMetrix SDKの使用
プロファイリング
プロファイリングは、ThreatMetrixがWebサイトまたはネイティブアプリケーションを介して顧客のオンラインサービスにアクセスしているデバイスに関する情報を収集するメカニズムです。
プロファイリングに最適な機会を提供するネイティブアプリケーションの画面を特定します。プロファイリングの大部分は短期間で完了します。プロファイリング属性の完全セットを収集するのに最大5秒かかる場合があります。
プロファイリングを開始できる一般的な画面は、アカウント作成画面、支払い画面、ログイン画面です。
必要な詳細
以下の詳細をconfigure()方法に送信します。
プレースホルダー | 説明 |
---|---|
TMXOrgId |
|
TMXFingerprintServer/Profiling domain |
|
インスタンスを取得して初期化
initProfile()
方法のTMXProfilinginsideのインスタンスを作成します。- 最小
TMXOrgId
とTMXFingerprintServer/Profiling domain
を送信してconfigure()
方法を呼び出します。
TMXProfilingクラスのsharedInstance()
方法は、ThreatMetrixオブジェクトのシングルトンインスタンスを返すために使用されます。インスタンスは一度だけ初期化する必要があります。
プロファイリングを開始します
プロファイリングを開始し、プロファイリング情報とともにいくつかの追加属性を送信する方法doProfile()
を作成します。
initProfile()方法とdoProfile()方法を作成して、インスタンスを作成し、プロファイリングを初期化する方法例:
import TMXProfiling
import TMXProfilingConnections
class TmxProfileController : ObservableObject{
//Get a singleton instance of TMXProfiling
let profile: TMXProfiling! = TMXProfiling.sharedInstance()
var sessionID : String = ""
func initProfile(){
// The profile.configure method is effective only once and subsequent calls to it will be ignored.
// Please note that configure may throw NSException if NSDictionary key/value(s) are invalid.
// This only happen due to programming error, therefore we don't catch the exception to make sure there is no error in our configuration dictionary
profile.configure(configData:[
// (REQUIRED) Organisation ID
TMXOrgID :"afevfjm6",
// (REQUIRED) Enhanced fingerprint server
TMXFingerprintServer :"ddc-test.worldpay.com"
])
}
func doProfile()
{
let customAttributes : [String : Array<String>] = [TMXCustomAttributes: ["attribute 1", "attribute 2"]]
// Fire off the profiling request.
// You will be notified of the profiling result in the closure passed in callbackBlock
let profileHandle: TMXProfileHandle = profile.profileDevice(profileOptions:customAttributes, callbackBlock:{(result: [AnyHashable : Any]?) -> Void in
let results:NSDictionary! = result! as NSDictionary
let status:TMXStatusCode = TMXStatusCode(rawValue:(results.value(forKey: TMXProfileStatus) as! NSNumber).intValue)!
let statusString: String =
status == .ok ? "OK" :
status == .networkTimeoutError ? "Timed out" :
status == .connectionError ? "Connection Error" :
status == .hostNotFoundError ? "Host Not Found Error" :
status == .internalError ? "Internal Error" :
status == .interruptedError ? "Interrupted Error" :
"Other"
print("\nProfile completed with: \(statusString)\nSession ID: \(self.sessionID)")
})
// Session id is immediately available on the instance of TMXProfileHandle following to the call to profile.profileDevice()
self.sessionID = profileHandle.sessionID;
print("Session equals :- \(self.sessionID)");
}
}
import TMXProfiling import TMXProfilingConnections class TmxProfileController : ObservableObject{ //Get a singleton instance of TMXProfiling let profile: TMXProfiling! = TMXProfiling.sharedInstance() var sessionID : String = "" func initProfile(){ // The profile.configure method is effective only once and subsequent calls to it will be ignored. // Please note that configure may throw NSException if NSDictionary key/value(s) are invalid. // This only happen due to programming error, therefore we don't catch the exception to make sure there is no error in our configuration dictionary profile.configure(configData:[ // (REQUIRED) Organisation ID TMXOrgID :"afevfjm6", // (REQUIRED) Enhanced fingerprint server TMXFingerprintServer :"ddc-test.worldpay.com" ]) } func doProfile() { let customAttributes : [String : Array<String>] = [TMXCustomAttributes: ["attribute 1", "attribute 2"]] // Fire off the profiling request. // You will be notified of the profiling result in the closure passed in callbackBlock let profileHandle: TMXProfileHandle = profile.profileDevice(profileOptions:customAttributes, callbackBlock:{(result: [AnyHashable : Any]?) -> Void in let results:NSDictionary! = result! as NSDictionary let status:TMXStatusCode = TMXStatusCode(rawValue:(results.value(forKey: TMXProfileStatus) as! NSNumber).intValue)! let statusString: String = status == .ok ? "OK" : status == .networkTimeoutError ? "Timed out" : status == .connectionError ? "Connection Error" : status == .hostNotFoundError ? "Host Not Found Error" : status == .internalError ? "Internal Error" : status == .interruptedError ? "Interrupted Error" : "Other" print("\nProfile completed with: \(statusString)\nSession ID: \(self.sessionID)") }) // Session id is immediately available on the instance of TMXProfileHandle following to the call to profile.profileDevice() self.sessionID = profileHandle.sessionID; print("Session equals :- \(self.sessionID)"); } }
プロファイリング結果の取得
TMXStatusCode
を使用してプロファイリングの結果を取得し、profileHandle.sessionId
を使用してSessionIdを取得します。プロファイリングが成功した場合は、プロファイリング結果のステータスがOK
として返されます。
デバイスデータと評価のリンク
deviceData.collectionReference
のsessionIdを次に含めてください:
次の手順