tachyon makes some great practical points. Personally, I've created many e-commerce sites and not experienced the problems mentioned. However, I have found that the authorization gateway (the entity that intercedes between your site and the merchant acct. to actually validate the card) can have various protocols, some of which can be tricky.

My favorite gateway provider allows a very easy to implement LWP:: UserAgent and HTTP::Request::Common interaction. You and your customer needs to decide what degree of validation is needed and just plug in the correct gateway codes.

Of course, you will need to purchase a secure certificate and have it installed on your server. Also, you will need to create and encrypt a key on the server, which you should store in a non-public area of your site. Here's a sample of a simple transaction in Perl:

use HTTP::Request::Common; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = POST 'https://secure.authorize.net/gateway/transact.dll', [ x_version => '3.1', x_delim_data => 'True', x_relay_response => 'False', x_login => 'somepassword', x_tran_key => $decrypted, x_amount => $totalamt, x_card_num => $ccnumber, x_exp_date => $month.$year, x_type => 'AUTH_CAPTURE', ]; my $reply; my $response = $ua->request($req); if ($response->is_success) { $reply = $response->content; } else { print STDERR $response->status_line, "\n"; } #parse $reply for authorized/decline codes and echo messages back to p +urchaser... my @replies = split(/,/, $reply); my $reason = $replies[3]; SWITCH: for ($replies[0]) { /2/ && do { &declined; last; }; /3/ && do { &error; last; }; $replies[0] = 0; }

Good luck!


—Brad
"Don't ever take a fence down until you know the reason it was put up." G. K. Chesterton

In reply to Re: Accepting Credit Cards by bradcathey
in thread Accepting Credit Cards by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.