Imaulle Posted August 2, 2011 Share Posted August 2, 2011 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 More sharing options...
Imaulle Posted August 2, 2011 Author Share Posted August 2, 2011 ohhhh nevermind figured it out with ob_get_contents() Link to comment https://forums.phpfreaks.com/topic/243560-viewing-curl-responses/#findComment-1250555 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.