Php 授权.net cim,获取客户付款配置文件

Php 授权.net cim,获取客户付款配置文件,php,authorize.net,authorize.net-cim,Php,Authorize.net,Authorize.net Cim,我正在使用Authorize.net的API,并尝试获取客户付款配置文件信息。我可以得到所有客户ID的列表,我想通过循环这些ID来获得客户付款信息。对于每个客户ID,我可以转储包含客户信息的数组,其中包括支付配置文件ID,但我无法确定如何提取是否要进行后续搜索: 我的代码是: $profileIds[] = $response->getIds(); $num_records = count($profileIds[0]); echo "There are " . $num_

我正在使用Authorize.net的API,并尝试获取客户付款配置文件信息。我可以得到所有客户ID的列表,我想通过循环这些ID来获得客户付款信息。对于每个客户ID,我可以转储包含客户信息的数组,其中包括支付配置文件ID,但我无法确定如何提取是否要进行后续搜索:

我的代码是:

$profileIds[] = $response->getIds();
    $num_records = count($profileIds[0]);
    echo "There are " . $num_records . " Customer Profile ID's for this Merchant Name and Transaction Key <br/>";

    for ($i = 0; $i < count($profileIds[0]); $i++) {
        $profile_id = $profileIds['0'][$i];
        echo "<br/><br/>$profile_id <br/>";

        // Retrieve an existing customer profile along with all the associated payment profiles and shipping addresses
        $cust_request = new AnetAPI\GetCustomerProfileRequest();
        $cust_request->setMerchantAuthentication($merchantAuthentication);
        $cust_request->setCustomerProfileId($profile_id);
        $cust_controller = new AnetController\GetCustomerProfileController($cust_request);
        $cust_response = $cust_controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::PRODUCTION);
        if (($cust_response != null) && ($cust_response->getMessages()->getResultCode() == "Ok") ){
            echo "GetCustomerProfile SUCCESS : " .  "\n";
            $profileSelected = $cust_response->getProfile();
            $paymentProfilesSelected = $profileSelected->getPaymentProfiles();

            echo "Profile Has " . count($paymentProfilesSelected). " Payment Profiles <br/>";
            $paymentProfileID = $paymentProfilesSelected->customerPaymentProfileId;
            echo "Payment Profile ID: $paymentProfileID<br/>";

            print_r($paymentProfilesSelected);
$profileIds[]=$response->getIds();
$num_records=count($profileid[0]);
呼应“有”$num_记录。“此商户名称和交易密钥的客户配置文件ID
”; 对于($i=0;$i
$profile_id
”; //检索现有客户配置文件以及所有关联的付款配置文件和发货地址 $cust_request=new AnetAPI\GetCustomerProfileRequest(); $cust_request->setMerchantAuthentication($merchantAuthentication); $cust\u request->setCustomerProfileId($profile\u id); $cust\u controller=new-AnetController\GetCustomerProfileController($cust\u请求); $cust\u response=$cust\u controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION); if(($cust\u response!=null)&&($cust\u response->getMessages()->getResultCode()==“Ok”)){ 回显“GetCustomerProfile成功:”。\n; $profileSelected=$cust_response->getProfile(); $paymentProfilesSelected=$profileSelected->getPaymentProfiles(); echo“Profile Has”.count($paymentprofiles已选中)。“paymentprofiles
”; $paymentProfileID=$PaymentProfileSelected->customerPaymentProfileId; echo“支付配置文件ID:$paymentProfileID
”; 打印(已选择付款档案);