2015-01-07 3 views
1

Я создаю веб-приложение 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)

+0

Вам необходимо обновить файл cert.pem из их SDK: https://github.com/AuthorizeNet/sdk-php – oddtwelve

ответ

0

Вполне возможно, что cert.pem файл в вашем SDK истек. Это сообщение имеет описание, что решить этот вопрос для меня:

https://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Authorize-Net-Begins-Infrastructure-and-SHA-2-Certificate/bc-p/50166#M445

Просто замените файл cert.pem в authnet/Lib/каталог Ssl в SDK с новым от этого места: http://curl.haxx.se/ca/cacert.pem

ссылка authorize.net выше, также относится к этому вопросу: SO cURL requires CURLOPT_SSL_VERIFYPEER=FALSE

Смежные вопросы