Jump to content

creating variable from authorize.net


turpentyne

Recommended Posts

I'm working with classes and don't know much about them. It's pulling data from authorize.net when a transaction is run. Maybe this is a general thing someone can help with? I include an AIM.class.php file in the page that process the transaction, 'registration4.php'. In the AIM.class.php I have this code that does print the transaction id to the page. The variable $pstr_trimmed looks like it gets used over and over for each 'case' :

 

case 7:
  echo "Transaction ID: ";
  echo $pstr_trimmed;
          /* thought I could just add $trans_id_variable = $pstr_trimmed; (didn't work */
  break;

 

But I don't know how to use that to type echo "$trans_id_variable" on register4.php or to insert it into my database?

 


<?php 
require("AIM2.class.php");

// here the data is set and the card processed, then...

if (!$approval = $aim->processCard("Workshops", $final_total)){
echo "<strong>Oops!</strong><br>Error proccessing credit card: " . print_r($aim->errorStack,1);
$appcodedesc = "Error processing credit card.";
$approval = 0;
}else{
// If we made it this far, the card was successfully charged
        // here the code echoes "Transaction ID: 1111111    Payment Approved"
echo "<strong><h3>Payment Approved</h3></strong><br>Successfully charged the credit card.  Add the attendee(s) name(s) below and submit. On the next page, you can print for your records. Please note that these are secure pages for payment processing, and pressing the back button in your browser, will bring up an expired page<br><br>"; // Approval code: " . $approval;
//echo $pstr_trimmed;
echo "and the new variable?";
       // but here's where I was hoping to take that transaction id and set it as a variable to put into the database.
echo $trans_id_test;
echo" should be before this";
$approval = 1;
$appcodedesc = "Payment Approved";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.