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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.