Jump to content

viewing cURL responses


Imaulle

Recommended Posts

I'm trying to write a payment module using some cURL commands and I can't figure out how to process the response.

When I run the script it loads up some code that I guess is coming from the cgi page?

 

How would I search that page for words like 'Declined' , 'Error' or 'Your information has been processed securely.'

 

Also, since this is for secure money transactions do I have the needed cURL options etc?

 

 

 

This is what I have so far:

 

    $fields_string ='';
    $fields = array(
        'vendor_id'=>urlencode($vendorid),
        'ret_addr'=>urlencode($ret_addr),
        'ccnum'=>urlencode($cardnumber),
        'ccmo'=>urlencode($month),
        'ccyr'=>urlencode($year),
        'mername'=>urlencode($mername),
        'first_name'=>urlencode($firstname),
        'last_name'=>urlencode($lastname),
        'address'=>urlencode($address),
        'city'=>urlencode($city),
        'state'=>urlencode($state),
        'zip'=>urlencode($postcode),
        'country'=>urlencode($country),
        'phone'=>urlencode($phone),
'email'=>urlencode($email),
'total'=>urlencode($amount),
    );

    foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');

        $ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://secure.itransact.com/cgi-bin/rc/ord.cgi');
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
$result = curl_exec($ch);
curl_close($ch);

 

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/243560-viewing-curl-responses/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.