7:35:52 AM
Thursday
Sep 09
Su M Tu W Th F Sa
567891011
12131415161718
19202122232425
262728293012
3456789

Play My Typing Game

View Some of My Artwork

simple form and action

<form method="post" action="process.php">
<table>
<tr><td>Credit Card Number:</td><td><input type="text" name="cc_num" /></td></tr>
<tr><td>Expiration</td><td>
</td></tr>
<tr><td>CVV:</td><td><input type="text" name="cc_cvv" /></td></tr>
<tr><td>Billing Address 1:</td><td><input type="text" name="cc_address_1" /></td></tr>
<tr><td>Billing City:</td><td><input type="text" name="cc_city" /></td></tr>
<tr><td>Billing State:</td><td>
</td></tr>
<tr><td>Billing Zip:</td><td><input type="text" name="cc_zip" /></td></tr>
<tr><td> </td><td><input type="submit" value="Submit"/></td></tr>
</table>
</form>
 


The above is a simple form with most of the requirements that will need to be passed.

<?
// process.php
include("authorizenet.class.php");

$total = 1;
$expiration = date("my", mktime(0,0,0,$_POST['cc_exp_month'],1,$_POST['cc_exp_year']));

        $cctrans = new authorizenet_class;

        $cctrans->add_field('x_login', 'xxxxxxxxx');
        $cctrans->add_field('x_tran_key', 'xxxxxxxxxxxxxxxx');

        $cctrans->add_field('x_version', '3.1');
        $cctrans->add_field('x_type', 'AUTH_ONLY'); // AUTH_CAPTURE
        $cctrans->add_field('x_test_request', 'FALSE');
        $cctrans->add_field('x_relay_response', 'FALSE');

        $cctrans->add_field('x_delim_data', 'TRUE');
        $cctrans->add_field('x_delim_char', '|');    
        $cctrans->add_field('x_encap_char', '');

        $cctrans->add_field('x_address', $_POST['cc_address_1']);
        $cctrans->add_field('x_city', $_POST['cc_city']);
        $cctrans->add_field('x_state', $_POST['cc_billing_state']);
        $cctrans->add_field('x_zip', $_POST['cc_zip']);
        $cctrans->add_field('x_country', 'US');


        //  Setup fields for payment information
        $cctrans->add_field('x_method', 'CC');
        $cctrans->add_field('x_card_num', $_POST['cc_num']);
        $cctrans->add_field('x_amount', number_format($total,2));
        $cctrans->add_field('x_exp_date', $expiration); // MMYY
        $cctrans->add_field('x_card_code', $_POST['cc_cvv']);

        $cctrans_result = $cctrans->process();

        if($cctrans_result != 1)
        {
                echo "Card Declined or other error<br />";
                echo $cctrans->dump_response();
                exit();
        }
        else
        {
                /* proceed */
        }
?>


Read Previous:
Authorize.net AIM Method Transaction class
Read Next:
an example of MySQL's SUBSTR function
Table of Contents


Give a listen to my music...
My Best Recordings
How my services and skills can help you:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local
    • Most all the above, but also:
      • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
      • Recording Live Music Audio
      • Video Streaming live music and other live events anywhere that can provide wifi
      • Training Video Streaming to your venue's trusted soundperson
Skills:
  • Global (via Email/Skype/AIM(ichat)/Yahoo)
    • Web Development Consulting
    • Custom Web App Development (PHP/MySQL/jQuery/CSS) Cross-Browser & OS
    • Cellphone App Development (Android/MobileWeb)
    • Music Lessons & Education for Beginner Guitar, Piano, Bass, which transfers over to many other instruments I am comfortable playing but not yet at teaching.
    • Music - Soundtrack Composition & Voice Work
  • Local, Most all the above, but also:
    • Music Performance (Harp, Voice, Guitar, Piano, Bass, Latin Percussion)
    • Being your venue's soundman
    • Video Streaming live music and other live events anywhere that can provide wifi
    • Training Video Streaming to your venue's trusted soundperson