Reply
Highlighted
Contributor
Posts: 15
Registered: ‎09-08-2014

Re: Is PHP/Curl not working on CIM updates?

I'm sorry - I've worked with XML before - I have an Authorize.net payment application that I built, but in that, there is a send.  I can't find a send in this code, and I'm not sure what I'm doing the echo on.
I would assume 
echo error_messages[];
would work, but it errors out.  It works when sending a payment through.

 

Is 
$this->process();
the send?

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is PHP/Curl not working on CIM updates?

[ Edited ]

There is a require('include/authorizenet.cim.class.php');

see if you can find createCustomerProfileRequest in that php file

 

 Is this how that php look like?

http://www.phpkode.com/source/s/authorize-net-cim-php-class/authorize-net-cim-php-class/authorizenet...

If so, in the 

function process($retries = 3)

 after

$this->response = curl_exec($ch);

 

echo $this->response

 

Highlighted
Contributor
Posts: 15
Registered: ‎09-08-2014

Re: Is PHP/Curl not working on CIM updates?

It is blank, so I put an echo $this->xml just before the curlopt_POST and here that is:
(this is not real data)
3xhfj5kfu67f  28283pT7579554v
Carr, D d@csi.com individual D Carr

23 Trail Dr.

Lake St. Louis MO 63367 US 4111111111111111 2017-04 D Carr

23 Trail Dr.

Lake St. Louis MO 63367 US

 

Does Authorize.net verify the address or credit card in the sandbox for CIM?  It's not real data.

 

Do I have it set up right for test mode?  $test_mode = true

function AuthNetCim($login, $transkey, $test_mode)
{
$this->login = $login;
$this->transkey = $transkey;
$this->test_mode = $test_mode;
$subdomain = ($this->test_mode) ? 'apitest' : 'api';
$this->url = "https://" . $subdomain . ".authorize.net/xml/v1/request.api";
//$this->url = "https://api.authorize.net/xml/v1/request.api";
}

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is PHP/Curl not working on CIM updates?

[ Edited ]

$this->response is blank, that would be the issue.

are you running this test using the sandbox account on your production server?

 

if it sending to the wrong server, it will return an account not valid or something in the response.

<messages><resultCode>Error</resultCode><message><code>E00007</code><text>User authentication failed due to invalid authentication values.</text></message></messages>

Highlighted
Contributor
Posts: 15
Registered: ‎09-08-2014

Re: Is PHP/Curl not working on CIM updates?

Do I have it set up right for test mode?  $test_mode = true

function AuthNetCim($login, $transkey, $test_mode)
{
$this->login = $login;
$this->transkey = $transkey;
$this->test_mode = $test_mode;
$subdomain = ($this->test_mode) ? 'apitest' : 'api';
$this->url = "https://" . $subdomain . ".authorize.net/xml/v1/request.api";
//$this->url = "https://api.authorize.net/xml/v1/request.api";
}

 

so it would be https://apitest.authorize.net/xml/v1/request.aspi (if my eyes are not too tired)

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is PHP/Curl not working on CIM updates?

[ Edited ]

for sandbox account, yes.

 

From http://php.net/manual/en/function.curl-setopt.php

can you add something like the following after the $this->response = curl_exec($ch);

if (curl_errno($ch)) {
            echo "Error: " . curl_error($ch);
}

 

with curl_setopt($ch, CURLOPT_HEADER, 1);

should have something like

HTTP/1.1 200 OK
Server: Apache
X-Backend-Server: pp-web03
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8
Date: Fri, 06 Aug 2010 15:32:00 GMT
Expires: Fri, 06 Aug 2010 01:42:00 GMT
Transfer-Encoding: chunked
X-Powered-By: PHP/5.2.9
X-Cache-Info: not cacheable; response has already expired
Highlighted
Contributor
Posts: 15
Registered: ‎09-08-2014

Re: Is PHP/Curl not working on CIM updates?

Error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Highlighted
Contributor
Posts: 15
Registered: ‎09-08-2014

Re: Is PHP/Curl not working on CIM updates?

This must not be set right:

 

curl_setopt($ch, CURLOPT_URL, $this->url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->xml);
echo "test1-".$this->xml."<BR>";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$this->response = curl_exec($ch);

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Is PHP/Curl not working on CIM updates?

did anything change on the server? updated anything?

google show a bunch of reason that your might be getting

"140770FC ssl23_get_server_hello unknown protocol curl"

Highlighted
Contributor
Posts: 15
Registered: ‎09-08-2014

Re: Is PHP/Curl not working on CIM updates?

I put a router before it - I'll bet there is a port that needs to be opened.

Would it be 443?