Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

authorize.net x.process returns Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    authorize.net x.process returns Error

    Dear experts,

    I'm using x.process() function in order to process Autorize.net transactions in my web application. Before application goes to production I'm using testing values for x.login_id and x.tran_key I've received from Autorize.net. However, the result x.process() function (with valid CC details) is always 3 that stands for Error ( Authorize.Net defines response code 3 as "Error").

    Here is the code:
    Code:
    dim x as AuthorizeNet_transaction
    dim tbl as P
    tbl=table.open("[PathAlias.ADB_Path]\company_data")
    tbl.fetch_first()
    	x.login =convert_type( tbl.Login_id,"C")
    	x.tran_key =convert_type( tbl.Transaction_key,"C")
    tbl.close()
    	x.amount =convert_type( CurrentForm.Controls.subs_amount.value,"C")
    	x.shipaddress =convert_type( CurrentForm.Controls.ShipAddress.value,"C")
    	x.billaddress =convert_type( CurrentForm.Controls.BillAddress.value,"C")
    	x.card_num =convert_type( CurrentForm.Controls.cc_num.value,"C")
    	x.exp_date =convert_type( CurrentForm.Controls.exp_date.value,"D")
    	x.type = "AUTH_CAPTURE"
    	x.first_name = convert_type( CurrentForm.Controls.fname,"C")
    	x.last_name = convert_type( CurrentForm.Controls.lname,"C")
    	x.car_code = convert_type( CurrentForm.Controls.ccv,"C")
    	dim result_msg as C
    	result_msg = ""
    	
    	'code to process payment
    	if x.process()then
     		dim y as P
      		y = x.result
       		result_msg = y.Response_Reason_Text
       		if (y.response_code = "1")     ' Authorize.Net defines response code 1 as "Approved"
       			session.transStatus = 1
        	elseif (y.response_code = "2")       'Authorize.Net defines response code 2 as "Declined"
            	session.transStatus = 2
            elseif (y.response_code = "3")       'Authorize.Net defines response code 3 as "Error"
                session.transStatus = 3
            end if
        else   
    		session.transStatus = 0
    	end if
    
    'session.transStatus = 1
    
    delete x ' remove AuthorizeNet object
    
    dim URL as c
    URL="result.a5w?msg="+result_msg 
    Response.redirect(URL)
    Can you please advise what is going on? Is it OK that for testing Autorize.net accounts the result is always 3 (Error)? May be I have some errors in my code? Or these are login_id and transaction_key values to blame?

    Any help will be highly appreciated,

    Thank you in advance,
    Olga

    #2
    Re: autorize.net x.process returns Error

    Olga,

    I think your problem is in conversion of the data.

    First of all, values coming out of your form are already character. They are all character. So, using convert_type(....,"C") is doing nothing. Instead, consider using alltrim().

    For phone numbers and creditcard numbers, people sometimes put in spaces of dashes, so for those, use remspecial()

    Second, and the probable cause of the error, you are converting the expiration data to a date. Authorize.net is looking for something like "032008". So, leave that a character value.

    Pat
    Pat Bremkamp
    MindKicks Consulting

    Comment


      #3
      Re: autorize.net x.process returns Error

      Pat,

      Thank you so much! I'll change my code using your instructions and check if it helps.

      Thanks again,
      Olga

      Comment


        #4
        Re: autorize.net x.process returns Error

        I changed the code as it is stated below, but it did not help :( The transaction again finishes with the code 3.

        Any other ideas why the result can be like this?

        Thank you,
        Olga

        Code:
        dim x as AuthorizeNet_transaction
        dim tbl as P
        tbl=table.open("[PathAlias.ADB_Path]\company_data")
        tbl.fetch_first()
             x.login =convert_type( tbl.Login_id,"C")
             x.tran_key =convert_type( tbl.Transaction_key,"C")
        tbl.close()
             x.amount =alltrim(convert_type( CurrentForm.Controls.subs_amount.value,"C"))
             x.shipaddress =alltrim(convert_type( CurrentForm.Controls.ShipAddress.value,"C"))
             x.billaddress =alltrim(convert_type( CurrentForm.Controls.BillAddress.value,"C"))
             x.card_num =remspecial(alltrim(convert_type( CurrentForm.Controls.cc_num.value,"C")))
             x.exp_date =remspecial(alltrim(convert_type( CurrentForm.Controls.exp_date.value,"C")))
             x.type = "AUTH_CAPTURE"
             x.first_name = alltrim(convert_type( CurrentForm.Controls.fname,"C"))
             x.last_name = alltrim(convert_type( CurrentForm.Controls.lname,"C"))
             x.car_code = alltrim(convert_type( CurrentForm.Controls.ccv,"C"))
             dim result_msg as C
             result_msg = ""
             
             'code to process payment
             if x.process()then
                   dim y as P
                    y = x.result
                     result_msg = y.Response_Reason_Text
                     if (y.response_code = "1")     ' Authorize.Net defines response code 1 as "Approved"
                          session.transStatus = 1
                 elseif (y.response_code = "2")       'Authorize.Net defines response code 2 as "Declined"
                     session.transStatus = 2
                elseif (y.response_code = "3")       'Authorize.Net defines response code 3 as "Error"
                    session.transStatus = 3
                end if
            else   
                  session.transStatus = 0
             end if
        
        'session.transStatus = 1
        
        delete x ' remove AuthorizeNet object
        
        dim URL as c
        URL="result.a5w?msg="+result_msg 
        Response.redirect(URL)

        Comment


          #5
          Re: autorize.net x.process returns Error

          A couple things I see:

          (1)
          x.amount should be numeric

          (2)
          What does your date format look like that you're sending them. Here's an example snippet from one of mine:

          vExpDate = t.Ccexpiremonth + chr(47) + right(t.Ccexpireyear,2)

          (3)
          I don't know if you understood Pat's recommendation about the convert_type(). It probably does no harm, but get rid of it. You're issuing an instruction that's not needed, and clutters your code. He's spot-on in his advice to use alltrim().
          -Steve
          sigpic

          Comment


            #6
            Re: autorize.net x.process returns Error

            Thank you very much for your replies!

            Now I just saw that the Response_Reason_Text in my case is "The merchant login ID or password is invalid or the account is inactive", so it seems that the problem is in login id/transaction key... May be I'm using the wrong values...

            Olga

            Comment


              #7
              Re: autorize.net x.process returns Error

              You should be using the test mode anyway at this point, I think.
              -Steve
              sigpic

              Comment


                #8
                Re: autorize.net x.process returns Error

                I wrote an email to Autorize.Net and described my problem. Their response was that the only reasons for this error can be:
                1. You are posting to the wrong URL
                2. You are posting the wrong value to x_login
                3. You are posting x_login in duplicate or not at all


                Now I'm completely lost... Where do I define an URL for posting? I have x.login and not x.x_login... May be this is the issue?

                Thank you for any help,
                Olga

                Comment


                  #9
                  Re: autorize.net x.process returns Error

                  I think I figured out what is happening... I was testing my application with developer test Authorize.Net account, but A5 is referencing to the https://secure.authorize.net/gateway/transact.dll server that is for go-live accounts only. I with my test account should be using https://test.authorize.net/gateway/transact.dll server.

                  How do I say to A5 to refer to the testing https://test.authorize.net/gateway/transact.dll server? Is it possible? Unfortunately I did not manage to find these settings...

                  Any hep is appreciated.

                  Thanks a lot,
                  Olga

                  Comment


                    #10
                    Re: autorize.net x.process returns Error

                    Originally posted by moiola View Post
                    How do I say to A5 to refer to the testing https://test.authorize.net/gateway/transact.dll server? Is it possible? Unfortunately I did not manage to find these settings...

                    Any hep is appreciated.

                    Thanks a lot,
                    Olga
                    Alpha doesn't allow that option...

                    Set your account to test mode within your authorize.net settings..
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                      #11
                      Re: autorize.net x.process returns Error

                      Al, thank you for your answer!
                      Now the puzzle seems to be solved :)

                      Comment


                        #12
                        Re: autorize.net x.process returns Error

                        Originally posted by moiola View Post
                        Al, thank you for your answer!
                        Now the puzzle seems to be solved :)
                        Olga

                        Let me reverse my last posting.

                        Looks like the documentation needs this update... This should do what you want.

                        _______________
                        The Authorize.Net transaction object has a mode property.

                        * If set to "Test", it uses https://test.authorize.net/gateway/transact.dll
                        * If set to "Validate", it uses https://developer.authorize.net/param_dump.asp
                        * If set to "Certify", it uses https://certification.authorize.net/...y/transact.dll
                        * If set to "Live", it uses the live server, https://secure.authorize.net/gateway/transact.dll

                        The default mode is "Live"

                        There is also a property, "test_mode", that allows you to send a test transaction to the live server without having to put the account into test mode first. This takes a logical value.

                        This functionality was added on 9/28/2007, so it should be in newer V8 patches as well as in V9.

                        ________

                        So you should be able to set
                        x.mode="Test"
                        and run against the test server.
                        Al Buchholz
                        Bookwood Systems, LTD
                        Weekly QReportBuilder Webinars Thursday 1 pm CST

                        Occam's Razor - KISS
                        Normalize till it hurts - De-normalize till it works.
                        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                        When we triage a problem it is much easier to read sample systems than to read a mind.
                        "Make it as simple as possible, but not simpler."
                        Albert Einstein

                        http://www.iadn.com/images/media/iadn_member.png

                        Comment


                          #13
                          Re: authorize.net x.process returns Error

                          Thank you Al for sharing this important info with me! I've used this approach and testing account is working now.

                          Thanks again!

                          Olga

                          Comment


                            #14
                            Re: autorize.net x.process returns Error

                            Al,
                            Just ran across your info about Authorize.net. You saved me a ton of time with that bit of information. Thanks. Even a year later!

                            Gordon Purcey

                            Comment

                            Working...
                            X