forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


General HTML Questions

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Miscellaneous
View previous topic :: View next topic  
Author Message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 04, 2006 1:13 pm    Post subject: General HTML Questions Reply with quote

This is not specifically about VDS, although I hope to be able to use VDS to do a couple of the steps:

I am trying to integrate my application with my credit card merchant account. I use Authorize.Net currently - via their virtual terminal.

Authorize.net has an integration method that seems pretty easy to use. The simplest method is to have a form with a submit button and when that button is pressed, it requests a simple payment form from the Authorize.net gateway. For example, here is that code:

<html>
<body>
<!--#INCLUDE FILE="simlib.asp"-->

<FORM METHOD=POST ACTION="https://secure.authorize.net/gateway/transact.dll">
<INPUT TYPE=HIDDEN NAME="x_Login" VALUE="mylogincode">
<INPUT TYPE=HIDDEN NAME="x_Show_Form" VALUE="PAYMENT_FORM">
<INPUT TYPE=HIDDEN NAME="x_Amount" VALUE="100.00">
<INPUT TYPE=HIDDEN NAME="x_first_name" VALUE="John">
<INPUT TYPE=HIDDEN NAME="x_last_name" VALUE="Doe">
<INPUT TYPE=SUBMIT VALUE="Click here for secure payment form">
</FORM>

</body>
</html>


When I put that code in a static page on my website and change "mylogincode" to the correct value, it works great. I click the button and I get a nice payment form for John Doe for $100.00, ready to have his credit card data entered.

Here is my question. Obviously I can't have a static web page for each customer. How can I pass a parameter when I call this page and have it integrate those values into the form?

Something like:

www.mysite.com/credcard.htm?fname=john&lname=doe

???

(Also, I know that I can use the string.dll to encode the URL that I send.)

If anyone with HTML knowledge can point me in the right direction, it would be much appreciated. My HTML experience is extremely limited.

Thanks -

_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 04, 2006 1:27 pm    Post subject: Reply with quote

One other thing - I don't think I can create a local .html page and run it in my browser for two reasons:

1.) It has to use the "InsertFP" function to generate a "fingerprint" to send also. (In the example above.)

2.) I have to have a referrer URL registered at Authorize.net. In other words, the request has to come from an http:// or https:// address.

_________________
Joe Floyd
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Apr 04, 2006 6:01 pm    Post subject: Reply with quote

If you can use PHP or ASP on your web server it would be quite easy to pass parameters to your script
and generate page content according to that.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 04, 2006 6:10 pm    Post subject: Reply with quote

Yes - I think I can use either of those on my server.

So how would I begin? For instance, how would I have my web server generate the html above, but be able to control whether it put "John" or "Sue" for the x_first_name in the form?

I guess I would need to write a PHP/javascript/vbscript script? And then use VDS to issue an HTTP Post command to it? I'm afraid that is above my abilities.

Basically, I want my local VDS executable to somehow generate a web page form (like above) and to send the value for the variables and have them used in the form code.

Thanks for the response - just not sure I quite understand.

_________________
Joe Floyd
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Apr 04, 2006 7:43 pm    Post subject: Reply with quote

To do what you need there you have to make a dynamic page on your web server. PHP and ASP are great for
that, and there are loads of help to find on the Net.

Then you call that page with the parameters you need (like you said, for instance http://www.yourserver.com/dynpage.php?name=John&surname=Doe), and it will be able to fill in the the document.

Small example in PHP:
Code:
<HTML>
<BODY>
<?php

$name = $_GET['name'];
$surname = $_GET['surname'];

echo "The name passed was: $name<BR>";
echo "The last name passed was: $surname<BR>";
?>
</BODY>
</HTML>


Remember that the file must have the PHP extension.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 04, 2006 7:59 pm    Post subject: Reply with quote

I'm going to test this out. Then if I get this to work I guess I would just change the output of the code to output something like:

echo '<input type=hidden name="x_first_name" VALUE=$name>'

Does that look right? (Instead of "John" in example above, replaced with $name)

_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 04, 2006 8:02 pm    Post subject: Reply with quote

Hmmm. Just tested out your example and I get no response. Maybe I don't have PHP after all. Shouldn't it be on a Windows server? Or is it just Linux?
_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Apr 04, 2006 8:26 pm    Post subject: Reply with quote

Okay - I have had some success. I looked at an online vbScript tutorial to try to set the same thing up as an .asp script - and it works!

Now I guess I just need to do some formatting and it should output my form, instead of just HTML text .... ? Hope so.

One other question, Dread -

If I get this part working, then the Authorize.net website is going to give me a response, letting me know if it is accepted or declined, etc. I can specify a URL for it to "POST" to. I guess that would be another script I would write? Could I then make that script accept the variables in the URL that is "Post"-ed, and then write that to a text file or something like that?

That way I can import that file into my database, etc.

_________________
Joe Floyd
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Apr 05, 2006 8:09 am    Post subject: Reply with quote

Exactemente... There's no difference in that. You just make another script to handle feedback from Authorize.net -
once you made the first one, the next should be really simple.

Good luck Wink

Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Apr 05, 2006 12:57 pm    Post subject: Reply with quote

Thanks for your help. Here is my solution:

<html>
<body>
<%
response.write "<form name=form method=post action=https://secure.authorize.net/gateway/transact.dll>"
response.write "<input type=hidden name=x_login value=xxxxxx>"
response.write "<input type=hidden name=x_show_form value=payment_form>"
response.write "<input type=hidden name=x_amount value=" & Request.QueryString("amount")& ">"
response.write "<input type=hidden name=x_first_name value=" & Request.QueryString("fname")& ">"
response.write "<input type=hidden name=x_last_name value=" & Request.QueryString("lname")& ">"
response.write "</form>"
response.write "<script>"
response.write "document.form.submit()"
response.write "</script>"
%>
</body>
</html>

I don't even have to press a button for the payment form - this automatically submits this form, so that by running this .asp script with the correct name and amount in the url, I get my payment form all ready to go! Pretty sweet. (I Googled around for these code snippets, amazing what you can find.)

Remaining issues:

1.) I need to write a script for the reply post, to record the results in a text file or database table on my web server.

2.) I plan to display this form in a VDSSURFX browser. I wish that there was a way in VDSSURFX to get the text of the page that is returned (so my VDS program would know immediately whether the transaction was accepted or declined.) I know that the VDS browser element has this capability, but in another thread, we established that the VDS browser won't work in some cases on a Windows Terminal Server, which I sometimes use.

So I am 90% of the way there - just a couple more hurdles.

_________________
Joe Floyd
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Miscellaneous All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group