Я создаю веб-приложение symfony2, чтобы при создании пользователя приложение должно было создать профиль для управления информацией о клиентах (cIM) authorize.net.Symfony2 не получает ответ от Authorize.net CIM
I Настройка учетных данных в parameters.yml:
authorizenet_login_id: MY_ACTUAL_LOGIN_ID
authorizenet_tran_key: MY_ACTUAL_KEY
authorizenet_test_mode: true
Здесь я прошу для CIM:
public function createUserPaymentProfile(Entity\User $user, $andFlush = true)
{
$paymentProfile = $this->getAuthorizeNetPaymentProfile(
$user->getOriginalCardNumber(),
$user->getExpirationDate()
);
$customerProfile = new \AuthorizeNetCustomer;
$customerProfile->merchantCustomerId = $user->getId();
$customerProfile->email = $user->getEmail();
$customerProfile->paymentProfiles[] = $paymentProfile;
$response = $this->authorizeNetCIM->createCustomerProfile($customerProfile);
if ($response->isOk()) {
$customerProfileId = $response->getCustomerProfileId();
$user->setAuthorizeNetCustomerProfileId($customerProfileId);
$customerPaymentProfileIds = $response->getCustomerPaymentProfileIds();
$customerPaymentProfileId = is_array($customerPaymentProfileIds)
? $customerPaymentProfileIds[0]
: $customerPaymentProfileIds;
$user->setAuthorizeNetCustomerPaymentProfileId($customerPaymentProfileId);
$this->em->persist($user);
if ($andFlush) {
$this->em->flush();
}
}
return $response;
}
Однако, я не получаю никакого ответа назад в следующей строке :
$response = $this->authorizeNetCIM->createCustomerProfile($customerProfile);
Это var_dump ответа:
object(AuthorizeNetCIM_Response)#899 (2) { ["xml"]=> NULL ["response"]=> bool(false) }
UPDATE: я отладил локон вызов, и это сообщение об ошибке я получаю от завитка ответа: SSL: проверка сертификата не удалось (результат: 5)
Вам необходимо обновить файл cert.pem из их SDK: https://github.com/AuthorizeNet/sdk-php – oddtwelve