Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
poofactory
May 6, 2003

by T. Finn
I'm trying to set up a web site to take credit cards through authorizenet using the AIM system.

I'm slightly familiar with perl so I'm trying to implement their sample code.

http://developer.authorize.net/samplecode/

They've hard coded all of the values like cc number, name, address into the script and I am able to set the script up on my web site and it works fine so I know all my passwords and permission settings are ok.

The problem I have, and it is probably because I have to training at all in comp sci, is editing the script to accept the values from a form and pass those values to the gateway.

For example, one value in my form:

<input id="FormsEditField1" type="text" name="Amount" style="white-space:pre" value="50.00" size="10" maxlength="10">

I have the form set up to post this value to the perl script.

The original perl script says:

x_amount => "12.23",

So I changed that to

x_amount => "Amount",

x_amount being the value that the gateway recognizes as the total charge and Amount being the data from my form.

But I get an error that says no valid amount supplied.

Am I supposed to write some actual code to get it to process the form data or can I just change this or another section somehow?

tef posted:

You realise that "Amount" is a string and "$Amount" is the string containing the variable $Amount ?

I would suggest continuing this over in the perl thread here

Does that mean I need to define the "$Amount" variable somewhere in the perl script beyond

x_amount => "$Amount",

?

Adbot
ADBOT LOVES YOU

poofactory
May 6, 2003

by T. Finn

genericadmin posted:

In your case, you want to assign it the data from the HTTP request form input. How you do that depends on what perl modules you are using to work with request data.

Thank you. I understand that is my problem. I haven't added anything to the sample code other than my passwords/account numbers.

What do I add to the perl script to take care of this?

Do I simply add "use xyz module" or do I need to code something more complicated to parse the data pairs?

Thanks.

poofactory
May 6, 2003

by T. Finn

tef posted:

A developer.

You are handling credit card details, so if you don't know about CGI, form escaping or the difference between "$Amount" and "Amount" it is time to give up and find someone who can.

(Sorry for the turn about, I was willing to give you the benefit of the doubt in missing something obvious - but your later posts expose your inexperience fully)

Well, I thought that if the sample code had everything set up and I just needed to configure a couple variables then I could do it. But if it is a lot more than that, I'll find a developer.

  • Locked thread