authorize.net cim, получить профиль оплаты клиента

Я использую API для Authorize.net и пытаюсь получить информацию о профиле платежа клиента. Я могу получить список всех идентификаторов клиентов, и я хотел бы просмотреть их, чтобы получить информацию о профиле клиента-оплаты. Для каждого идентификатора клиента я могу вывести массив, содержащий информацию о клиенте, которая включает идентификатор профиля платежа, но я не могу понять, как извлечь, если выполнить последующий поиск:

Мой код:

$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);

2

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector