Working With The authorize.net Server Integration Method (SIM) Payment Gateway, Part 1: Don’t Use JavaScript
I got an email a few days ago from a reader seeking help with the authorize.net Server Integration Method (SIM) credit card payment gateway.
Specifically, he was asking how he could use JavaScript to pass a calculated total to a PHP page that contains the SIM code.
- A customer chooses a series of options from some select lists, radio buttons and the like;
- the page calculates an order total;
- the end user hits a submit button;
- the results are posted to the SIM processing page, which acts as a “confirmation page”; and
- The customer presses another button, which takes him to authorize.net to provide payment info and actually charge the card.
You can see an approximation of what I’m talking about here: http://www.dougv.com/demo/js_form_values. The questioner’s form is similar to this approximation in function.
Parent-Child DropDownList Controls In ASP.NET Web Forms (VB.NET)
Some time ago I promised a formspring anon I would do a tutorial on parent / child DropDownList controls in ASP.NET Web Forms. At long last, I’m delivering. (From here on out, I will use “DropDownList” and “select list” interchangeably.)
I’ll be demonstrating two different ways to accomplish this task, as well as a few variations on the first: First, binding with only SqlDataSource controls, which is by far the easiest way to proceed and will suffice for about 90 percent of applications; second, using code behind and CompareValidator controls, to cover all possible roadblocks.
Some notes before we proceed:
- I’ll use the ZIP Code database I’ve been using for a while as the back-end data. I also have a separate table of USPS state codes I’m using as the parent data, to help illustrate that you can use several tables / data sources to fuel this solution, provided the keys that relate the data make sense to each data store. In other words, you can use a lot of different sources for your data, so long as the data is relational.
- I’m going to use SQL Server, stored procedures and a connection string stored in my web.config file to access my data. I recognize that some people prefer to use SQL statements / LINQ and the like, or can only use Access / MySQL or other data stores. I really urge you to always use stored procedures, as they are way safer than inline SQL statements. As far as alternative data stores go, that should be a easy a fix as switching your code to use to the relevant ADO.NET ODBC classes, rather than the SQL Client classes.
- This solution should work for ASP.NET versions 2.0 forward.
Continue reading: Parent-Child DropDownList Controls In ASP.NET Web Forms (VB.NET) »
binding a data from database to dropdownlist based on selected item of another dropdown list
I blogged about doing this with PHP / MySQL / jQuery at http://dougv.us/64 , http://dougv.us/4s and http://dougv.us/4r . If you’re looking for an ASP.NET Web Forms version, I’ll add this to my "to blog" list. Can’t say as to when I’ll get around to it, but probably not immediately, sorry.
Parent – Child Select Lists Revisited: Multiple Parent – Child Select Lists Via PHP, MySQL And jQuery
A while ago, I promised to answer Brian’s request for a demonstration of how to make multiple parent / child select lists — in other words, starting from one drop down / select list, having two or more child lists, each of which, in turn, may act as a parent to another list.
Multiple parent-child select lists are considerably more complicated to program than a single parent-child relationship. Not only do we have additional data relationships to consider (that is, how we’re going to tie child list values to the selected parent values), we now need to plan for what to do if a “middle” relationship is changed (more on this shortly).
Fortunately, we have a starting point in my original parent-child select list post. We don’t need to reinvent the wheel, therefore, so much as we need to upgrade from a horse cart to a Lamborghini.
Overview Of The Approach
As was the case when we had a single child drop-down list, we must begin with relational data for each select list. Apologies to those who consider that obvious, but for n00bs, what I mean is, if you want to select a value from List A and have List B populated with new values, then the values you intend to have in List B must somehow be keyed (linked) to the selection made in List A.
This multiple parent-child select list approach will work for as many parent-nee-child lists you want. If you want to populate 10 or 100 or 1,000 lists, you won’t need to change a single line of JavaScript; however, your PHP “helper” page will need some modification to accommodate all the queries you’ll need, and the more lists you have, the more code you’ll have to put into your HTML (more on this shortly).
Parent – Child Select Lists Revisited: Validating Selected Options Via jQuery And PHP
Recently received via e-mail, in response to my previous blog entry, “Using AJAX To Data Bind A Child Drop Down List Based On The Selected Option Of A Parent Select Control“:
Would you be interested in modifying your solution in 2 ways. One would be to have it contain a country downdown as well. So it would be parent, child, child. I looked into attempting it myself, but my head began spinning as I began looking at all the code. The next option that would be nice, would be to have some sort of Dropdown Validation. Once the state is selected and the city is not yet selected, i am able to hit the submit button. So, it would be nice to see a message that says “Please fill choose a city”. …
Thank you,
Brian
I’m actually going to address this in two posts, because the first request — nested parent-child select lists — will take a bit more time to demo and describe than I have at the moment.
However, form validation — namely, ensuring the user chooses valid parent and child values from each select list — is something I can describe quickly and without extensive coding. And it’s a subject I should address, since my previous post noted that server-side validation was important to this solution, but I didn’t describe how to do it.



