Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation coldfusion payment facility

    Hi all i would like to create a simple payment facility using coldfusion. How do i go about this? Are there tutorials on

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Can you describe in more detail what your trying to do? Are you wanting like an e-commerce site?

    I would recommend you re-consider your language choice since ColdFusion is a horrible language. I have to use at work sometimes, we have nothing but problems with it. Use something more current like PHP or ASP .net, you'll find more tutorials and help if you do that too since there aren't as many ColdFusion developers as PHP or ASP.
    OracleGuy

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is a demo and i am hoping to use it for membership fee, payment for books, and micro payments. Ithink you r right. i may need to reconsider my options

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    Las Vegas, NV - USA
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oracleguy
    I would recommend you re-consider your language choice since ColdFusion is a horrible language. I have to use at work sometimes, we have nothing but problems with it. Use something more current like PHP or ASP .net, you'll find more tutorials and help if you do that too since there aren't as many ColdFusion developers as PHP or ASP.
    I'm not sure where the "horrible language" comment came from, my guess is from a lack of experience with CF. CF is very strong. CFMX is even stronger. 98%+ of the sites on the web can be written using native CF functionality without the need for installing plug-ins, COM objects or modifying the core. The biggest factor for the lack of market share is price point -- PHP is free and the original ASP came free with the Windows Server that you needed to run CF. And while you can run CF on Apache, most people running Apache would prefer PHP because it's free (just like Apache).

    If time to market is your biggest concern, I would pick CF everytime. If costs are your biggest concern (excluding labor costs developing the site), I would pick PHP. ASP (especially .Net) has not proven itself to me yet...
    Steven Sommers (blog)
    Shift4 Corporation -- www.shift4.com

    Creators of $$$ ON THE NET(tm) payment processing services.

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by Shift4Sms
    I'm not sure where the "horrible language" comment came from, my guess is from a lack of experience with CF. CF is very strong. CFMX is even stronger.
    Not to flame you or anything, but I'd say the samething back at you for making that comment. Things like oh... if you have a server with multiple coldfusion powered sites on it, and let's assume you have a index.cfm in each one... sometimes when you view site A, it will show the index.cfm from site B. That's one of the biggest problems we've had, and it isn't with one server either. The language syntax is half decent, it is macromedia's actual processing of that code that is the problem.

    There are some aspects that are good about it, like the way you can run queries and stuff, that's where being tag-based is nice. You can format your queries real nice and stuff but you can do that with PHP too. Back in the day CF was a good choice but now days especially with the huge price tag on it, I wouldn't use it.
    OracleGuy

  • #6
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks but so far no info on how to build a demo payment system using coldfusion

  • #7
    Regular Coder
    Join Date
    Jul 2002
    Location
    Las Vegas, NV - USA
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oracleguy
    Not to flame you or anything, but I'd say the samething back at you for making that comment. Things like oh... if you have a server with multiple coldfusion powered sites on it, and let's assume you have a index.cfm in each one... sometimes when you view site A, it will show the index.cfm from site B. That's one of the biggest problems we've had, and it isn't with one server either. The language syntax is half decent, it is macromedia's actual processing of that code that is the problem.

    There are some aspects that are good about it, like the way you can run queries and stuff, that's where being tag-based is nice. You can format your queries real nice and stuff but you can do that with PHP too. Back in the day CF was a good choice but now days especially with the huge price tag on it, I wouldn't use it.
    No flaming taken. Sorry if I came across as a flamer (in the straight/non-gay sense) -- it was late.

    I have multiple sites running on multiple servers and have never experienced the index.cfm (or any template) confusion. Maybe it was a problem with prior versions? I have limited experience on CF4.5 and CFMX and a lot of experience on CF5 and have not seen this behavior.

    Anyway, I fully agree, it is pricey BUT, depending on the application, it may be worth it because of the labor saving in development. My rule of thumb is that if the project would take over a month to program in PHP, then you'll probably see a savings in doing it in CF. Otherwise PHP is the way to go (and you know my thoughts on ASP). This rule of thumb is assuming that you have a similar experience level with CF and PHP.

    As to the original point to this topic: "how to create a simple payment facility using coldfusion". I'm still uncertain to how much detail you are asking. In the ColdFusion Developer's Exchange area on the Macromedia site there is a tag that I developed to interface to our payment gateway, CF_Shift4OTN. The usage example has a call to the tag with hard-coded card information. For your payment example, it's just a matter of changing the hard-coded values into FORM field values entered by the customer and then prettying up the responses (instead of "Approved", some sort of thank you message or instead of "Declined", some sort of go away you dead-beat message )

    Is that what you were looking for?
    Last edited by Shift4Sms; 06-02-2004 at 08:12 PM.

  • #8
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    coldfusion random quiz generator

    thanks for the Shift4 $$$ example it was great. I am trying to create a kind of exam using coldfusion for some kids but i am stuck. i tried to attach the database in a ZIP file but it is too large.
    Last edited by sagat; 06-14-2004 at 12:05 PM.

  • #9
    Regular Coder
    Join Date
    Jul 2002
    Location
    Las Vegas, NV - USA
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sagat
    any help would be appreciated. I am also considering using ASP. any ideas on asp
    I don't have the time right now to look at your project example (maybe sometime this weekend???) but I can send you ASP code that does the same as the CF tag. Let me know if you need it...

  • #10
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks that would be great
    Last edited by sagat; 06-11-2004 at 09:03 PM.

  • #11
    Regular Coder
    Join Date
    Jul 2002
    Location
    Las Vegas, NV - USA
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is an example that I found. I have a better one somewhere but I thought this one would be better than nothing for you...

    <%@ Language=JScript%>

    <%
    Server.ScriptTimeout = 65;

    function s4PostStr(strURL,strFields) {
    var xmlHttp, result;

    xmlHttp = Server.CreateObject("Msxml2.XMLHTTP");

    try {
    xmlHttp.Open("POST",strURL,false);
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.Send(strFields);
    result = xmlHttp.responseXML;
    }
    catch(e) {
    result = e;
    }

    xmlHttp = null;

    return result;
    }

    function s4GetVal(xmlDoc,strName,strDefault) {
    var root, node, result;

    result = strDefault;
    root = xmlDoc.selectSingleNode("xmldata");
    if (root != null) {
    node = root.selectSingleNode(strName);
    if (node != null) {
    result = node.text;
    }
    node = null;
    root = null;
    }
    return result;
    }

    function s4SetVal(xmlDoc,strName,strValue) {
    var root, node;

    root = xmlDoc.selectSingleNode("xmldata");
    if (root == null) {
    root = xmlDoc.createNode("element","xmldata","");
    xmlDoc.appendChild(root);
    }

    node = root.selectSingleNode(strName);
    if (node == null) {
    node = xmlDoc.createNode("element",strName,"");
    root.appendChild(node);
    }
    node.text = strValue;
    node = null;
    root = null;
    }

    function s4Post(strURL,xmlRequestDoc,xmlResponseDoc) {
    var nodeList, nodeElems, node, strFields, strResponse, result;

    strFields = "STX=YES&CONTENTTYPE=XML&VERBOSE=YES";
    nodeList = xmlRequestDoc.getElementsByTagName("*");
    nodeElems = nodeList.length;
    for (i = 0; i < nodeElems; i = i + 1) {
    node = nodeList.item(i);
    if (node.text != "")
    strFields = strFields + "&" + node.nodeName + "=" + escape(node.text);
    }
    node = null;
    nodeList = null;
    strFields = strFields + "&ETX=YES";

    result = false;
    s4SetVal(xmlResponseDoc,"errorindicator","N");
    s4SetVal(xmlResponseDoc,"primaryerrorcode","0");
    s4SetVal(xmlResponseDoc,"secondaryerrorcode","0");
    s4SetVal(xmlResponseDoc,"longerror","");
    s4SetVal(xmlResponseDoc,"shorterror","");
    strResponse = s4PostStr(strURL,strFields);
    try {
    xmlResponseDoc.async = false;
    result = xmlResponseDoc.load(strResponse);
    if (!result) {
    s4SetVal(xmlResponseDoc,"errorindicator","Y");
    s4SetVal(xmlResponseDoc,"primaryerrorcode","9999");
    s4SetVal(xmlResponseDoc,"secondaryerrorcode","2");
    s4SetVal(xmlResponseDoc,"longerror","COM/XML Failure: " + strResponse + " (URL=" + strURL + ")");
    s4SetVal(xmlResponseDoc,"shorterror","COM/XML FAILURE");
    }
    }
    catch(e) {
    s4SetVal(xmlResponseDoc,"errorindicator","Y");
    s4SetVal(xmlResponseDoc,"primaryerrorcode","9999");
    s4SetVal(xmlResponseDoc,"secondaryerrorcode","1");
    s4SetVal(xmlResponseDoc,"longerror","COM/XML Failure: " + e + " response=" + strResponse + " url=" + strURL);
    s4SetVal(xmlResponseDoc,"shorterror","COM/XML FAILURE");
    }
    return result;
    }
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>XML Test Script</title>
    </head>

    <body>
    <h1>XML Test Script</h2>
    <%
    var xmlDoc, nodeList, nodeElems, node, i, str;

    xmlDoc = Server.CreateObject("Msxml2.DOMDocument");

    s4SetVal(xmlDoc,"vendor","Shift4ASPTest");
    s4SetVal(xmlDoc,"serialnumber","174");
    s4SetVal(xmlDoc,"username","DemoAPI");
    s4SetVal(xmlDoc,"password","demo");
    s4SetVal(xmlDoc,"merchantid","34025");
    s4SetVal(xmlDoc,"functionrequestcode","1D");
    s4SetVal(xmlDoc,"merchantid","34025");
    s4SetVal(xmlDoc,"cardnumber","4222222222222");
    s4SetVal(xmlDoc,"expirationmonth","12");
    s4SetVal(xmlDoc,"expirationyear","2005");
    s4SetVal(xmlDoc,"primaryamount","1.00");

    s4Post("https://testing.shift4.com/api/s4tran_action.cfm",xmlDoc,xmlDoc);
    Response.write("errorindicator = " + s4GetVal(xmlDoc,"errorindicator","HUH?") + "<br>");

    nodeList = xmlDoc.getElementsByTagName("*");
    nodeElems = nodeList.length;
    for (i = 0; i < nodeElems; i = i + 1) {
    node = nodeList.item(i);
    Response.write(node.nodeName + " = " + node.text + "<br>");
    }
    node = null;
    nodeList = null;

    xmlDoc = null;
    %>
    </body>
    </html>
    Steven Sommers (blog)
    Shift4 Corporation -- www.shift4.com

    Creators of $$$ ON THE NET(tm) payment processing services.

  • #12
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks i am not sure how to use the code. i was trying to create something like the macromedia exams you take online but much simpler. any ideas


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •