Web Hosting Talk







View Full Version : Couple of coding questions...


poslundc
10-20-2004, 11:22 AM
Hi all,

I'm coding a PHP frontend to a CC gateway and could use a couple of pointers... (searched the forums but didn't find anything that seemed to answer them)

1. Is there a preferred technique to preventing multiple form submissions? Right now I am thinking of just locking the user out through JavaScript (by disabling the submit button and changing the onsubmit event handler to cancel any future attempts), but this is problematic if the connection is rejected, and doesn't stop the user from doing a back->submit-again. (JavaScript isn't a problem since the rest of the site is already heavily reliant on it and is pretty much non-functional if the user has it disabled.)

2. I notice that sites like Amazon tend to ask for first and last name in a single field. How do they deal with splitting up names the way it is required by the gateway if there are more than two? Can you make any safe assumptions about the way they will be distributed?

Thanks,

Dan.

pickles
10-20-2004, 11:53 AM
The "Java" dual submit didn't work very well for us. We use the Authorize.Net SIM protocol and mark our orders as "Pay Pending" just prior to sending the buyer off to the payment gateway. AuthNet "posts" back to our servers after the buyer makes a payment attempt.

We catch duplicates there and simply void the duplicate before the batch closes. It doesn't happen that often and when it does it is typically because AuthNet was had posting problems. This was most noticiable during their recent DDOS attacks.

We collect the name in three fields, first, middle and last. We allow the customer to enter their suffix if applicable in the last name field. I suspect that Amazon parses the full name and extracts the first, last, middle.... pieces out. I simply didn't want to take the time to write and validate that code.

Bob