1

有没有人想出一种优雅的方法来搜索存储在 Authorize.net 的客户信息管理器 (CIM) 上的数据?

根据他们的 XML Guide,似乎根本没有任何搜索功能。这是一个巨大的缺点。

据我了解,CIM 的卖点是商家不需要存储任何客户信息。他们只是为每个人存储一个唯一的标识符,并根据需要检索数据。从 PCI 合规性的角度来看,这可能很棒,但从灵活性的角度来看,这很可怕。

像“显示来自德克萨斯的所有订单”这样的简单搜索突然变得非常复杂。

你们其他人是如何处理这个问题的?

4

3 回答 3

2

The short answer is, you're correct: There is no API support for searching CIM records. And due to the way it is structured, there is no easy way to use CIM alone for searching all records.

To search them in the manner you describe:

  1. Use getCustomerProfileIdsRequest to get all the customer profile IDs you have stored.
  2. For each of the CustomerProfileIds returned by that request, use getCustomerProfileRequest to get the specific record for that client.
  3. Examine each record at that time, looking for the criterion you want, storing the pertinent records in some other structure; a class, a multi-dimensional array, an ADO DataTable, whatever.

Yes, that's onerous. But it is literally the only way to proceed.

The previously mentioned reporting API applies only to transactions, not the Customer Information Manager.

Note that you can collect the kind of data you want at the time of recording a transaction, and as long as you don't make it personally identifiable, you can store it locally.

For example, you could run a request for all your CIM customer profile records, and store the state each customer is from in a local database.

If all you store is the state, then you can work with those records, because nothing ties the state to a specific customer record. Going forward, you could write logic to update the local state record store at the same time customer profile records are created / updated, too.

I realize this probably isn't what you wanted to hear, but them's the breaks.

于 2010-11-28T18:40:41.053 回答
1

这可能非常缓慢且效率低下。但这里有一种方法。请求所有客户 ID 的数组,然后检查每个客户 ID 的字段...在我的情况下,我想要 PHP 中的电子邮件搜索功能:

$cimData = new AuthorizeNetCIM;
$profileIds = $cimData->getCustomerProfileIds();

$profileIds = $cimData->getCustomerProfileIds();
$array = $profileIds->xpath('ids');
$authnet_cid = null;

/*
this seems ridiculously inefficient... 
gotta be a better way to lookup a customer based on email
*/

    foreach ( $array[0]->numericString as $ids ) { // put all the id's into an array
       $response = $cimData->getCustomerProfile($ids); //search an individual id for a match
    //put the kettle on

        if ($response->xml->profile->email == $email) {
            $authnet_cid = $ids;
            $oldCustomerProfile = $response->xml->profile;
        }
    }

// 现在茶已经准备好了,奶油、糖、饼干,你可能会得到你的搜索结果!

于 2011-02-18T17:58:20.773 回答
0

CIM's primary purpose is to take PCI compliance issues out of your hands by allowing you to store customer data, including credit cards, on their server and then access them using only a unique ID. If you want to do reporting you will need to keep track of that kind of information yourself. Since there's no PCI compliance issues with storing customer addresses, etc, it's realistic to do this yourself. Basically, this is the kind of stuff that needs to get flushed out during the design phase of the project.

They do have a new reporting API which may offer you this functionality. If it does not it's very possible it will be offered in the near future as Authnet is currently actively rolling out lots of new features to their APIs.

于 2010-11-23T21:52:50.000 回答