clay1 Posted February 15, 2010 Share Posted February 15, 2010 When someone registers for an event on my site, we collect their information on a form and then pass it to our merchant provider who processes the payment and then returns the customer to a page on our site depending on if their card was approved or not. I have a form that collects more information than what the merchant provider requires. For example: Age. I need to save that extra information in my database and then pass the variables required to my merchant provider. This is the opening of the form code provided by the merchant: <form id="form" action="https://www.eProcessingNetwork.com/cgi-bin/dbe/order.pl" method="post" /> I would like to avoid having multiple pages or clicks for the customer. Is that possible? Can I have the form variables saved to my table AND go to the merchant page in 1 click? Quote Link to comment https://forums.phpfreaks.com/topic/192200-registration-and-payment-save-information-into-database-and-process-payment/ Share on other sites More sharing options...
clay1 Posted February 16, 2010 Author Share Posted February 16, 2010 Seems I can use Curl to do what I want, but am not familiar with it.. Any advice? Quote Link to comment https://forums.phpfreaks.com/topic/192200-registration-and-payment-save-information-into-database-and-process-payment/#findComment-1012893 Share on other sites More sharing options...
idontkno Posted February 16, 2010 Share Posted February 16, 2010 I'm not exactly sure what you mean, but is this it? $curl_session = curl_init(); curl_setopt($curl_session, CURLOPT_URL, "https://www.eProcessingNetwork.com/cgi-bin/dbe/order.pl"); curl_setopt($curl_session, CURLOPT_POSTFIELDS, "para1=val1¶2=val2&etc"); curl_exec($curl_session); curl_close($curl_session); Quote Link to comment https://forums.phpfreaks.com/topic/192200-registration-and-payment-save-information-into-database-and-process-payment/#findComment-1012897 Share on other sites More sharing options...
clay1 Posted February 16, 2010 Author Share Posted February 16, 2010 I'm not exactly sure what you mean, but is this it? Basically I am trying to seamlessly save the customer information and then bring them to the processing URL without requiring the use to click multiple times. More information on what I am using: http://www.eprocessingnetwork.com/dbe.html What I want to happen is: 1.Customer fills out form. 2. Clicks submit 3. Customer information is entered into table 4. Customer is brought to the order.pl page to enter their credit card 5. Customer clicks submit and their card is approved or declined. What I don't want is for the customer to need to do anything else between 3 and 4. Does that make sense? I tried the following which I found on http://davidwalsh.name/execute-http-post-php-curl After I hit submit, it shows me the payment gateway and the fields are filled out. The URL in the browser is my site's and when I click 'submit' it tries to bring me to mysite.com/transact.pl which obviously doesn't exist. extract($_POST); //set POST variables $url = 'https://www.eProcessingNetwork.com/cgi-bin/dbe/order.pl'; $fields = array( 'Total'=>urlencode($Total), 'ePNAccount'=>urlencode($ePNAccount), 'FirstName'=>urlencode($FirstName), 'LastName'=>urlencode($LastName), 'Address'=>urlencode($Address), 'City'=>urlencode($City), 'State'=>urlencode($State), 'Zip'=>urlencode($Zip), 'EMail'=>urlencode($EMail), 'ID'=>urlencode($ID), 'ReturnApprovedURL'=>urlencode($ReturnApprovedURL), 'ReturnDeclinedURL'=>urlencode($ReturnDeclinedURL), 'Phone'=>urlencode($telephone) ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); //execute post $result = curl_exec($ch); //close connection curl_close($ch); Quote Link to comment https://forums.phpfreaks.com/topic/192200-registration-and-payment-save-information-into-database-and-process-payment/#findComment-1012910 Share on other sites More sharing options...
clay1 Posted February 16, 2010 Author Share Posted February 16, 2010 So far anyone who has attempted to answer this or anything I have found has said 'curl' but as yet no one can help me with anything very specific? Anyone? Am I shouting in the dark here? Quote Link to comment https://forums.phpfreaks.com/topic/192200-registration-and-payment-save-information-into-database-and-process-payment/#findComment-1012955 Share on other sites More sharing options...
clay1 Posted February 16, 2010 Author Share Posted February 16, 2010 I'm still stuck on this Quote Link to comment https://forums.phpfreaks.com/topic/192200-registration-and-payment-save-information-into-database-and-process-payment/#findComment-1013276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.