Jump to content

Registration and payment. Save information into database and process payment


Recommended Posts

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?

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&para2=val2&etc");

curl_exec($curl_session);

curl_close($curl_session);

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);

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.