Google Cloud Platform 的 DLP API

在「New ways to manage sensitive data with the Data Loss Prevention API」這邊提到三月的時候就推出了 DLP API (在「Discover and redact sensitive data with the Data Loss Prevention API」這邊提到的),不過沒什麼印象:

The Data Loss Prevention (DLP) API, which went beta in March, can help you quickly find and protect over 50 types of sensitive data such as credit card numbers, names and national ID numbers.

這次看了一下範例,可以直接對圖片上面分析:

先記起來,看起來之後應該有機會用到?(像是分析使用者上傳的圖片)

偵測信用卡交易是否為盜刷的服務

翻資料的時候發現 Sift Science 這家公司,直接看官網提供的範例程式碼會比較清楚,PHP code 長這樣:(在 single quote 裡面放變數,看起來不會動 XDDD)

require 'sift-php/lib/Services_JSON-1.0.3/JSON.php';
require 'sift-php/lib/SiftRequest.php';
require 'sift-php/lib/SiftResponse.php';
require 'sift-php/lib/SiftClient.php';

$sift = new SiftClient('my_api_key');
$response = $sift->track('$transaction', array(
  '$user_id' => '$billy_jones_301',
  '$user_email' => '$bill@gmail.com',
  '$transaction_type' => '$sale',
  '$transaction_status' => '$success',
  '$amount' => '100000000',
  '$currency_code' => 'USD',
  '$billing_address' => array(
    '$name'         => 'Bill Jones',
    '$phone'        => '1-415-555-6041',
    '$address_1'    => '2100 Main Street',
    '$address_2'    => 'Apt 3B',
    '$city'         => 'New London',
    '$region'       => 'New Hampshire',
    '$country'      => 'US',
    '$zipcode'      => '03257'
  ),
  '$payment_method' => array(
    '$payment_type'    => '$credit_card',
    '$payment_gateway' => '$braintree',
    '$card_bin'        => '542486',
    '$card_last4'      => '4444'
  )
));

https://packagist.org/search/?q=Sift 這邊也有看到一些東西,應該也可以用 Composer 掛起來用...

費用的部份,量夠大的時候,平均下來就是一筆 USD$0.01 (前一萬筆不用錢,接下來一萬筆 USD$0.02,然後都是 USD$0.01),約 NTD$0.3:

First 10,000 transactions per month Free!
Next 10,000 transactions 2¢ each
Every transaction above that 1¢ each