1

I am setting up a symfony2 web application so that upon creating a user, the application should create a profile on authorize.net's Customer Information Management (CIM).

I setup the credentials in parameters.yml:

authorizenet_login_id: MY_ACTUAL_LOGIN_ID
authorizenet_tran_key: MY_ACTUAL_KEY
authorizenet_test_mode: true

This is where I request for a 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;
}

However, I don't get any response back in the following line:

$response = $this->authorizeNetCIM->createCustomerProfile($customerProfile);

This is the var_dump of the response:

object(AuthorizeNetCIM_Response)#899 (2) { ["xml"]=> NULL ["response"]=> bool(false) }

UPDATE: I debugged the curl call, and this is the error message I am getting from the curl response: SSL: certificate verification failed (result: 5)

1 Answers1

0

It's possible that the cert.pem file in your SDK has expired. This post has a description that solved the issue for me:

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

Simply replace the cert.pem file in the authnet/lib/ssl directory in the SDK with a new one from this location: http://curl.haxx.se/ca/cacert.pem

The authorize.net link above also refers to this SO question: cURL requires CURLOPT_SSL_VERIFYPEER=FALSE

Community
  • 1
  • 1
lwitzel
  • 591
  • 5
  • 15