General Chat
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsGeneralGeneral Chat

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 17th, 2005, 07:16 PM
LLX LLX is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,121 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 44 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
Authoirze.net

this is sorta general, sorta code bassed not quite sure if it goes here

in any case anyone use authoize.net im notincing soe very strage quirks in the aim script liek the declaration of

$auth_net_url = "https://certification.authorize.net/gateway/transact.dll";

but then the curlfunction just uses the direct url not the varable and the var is use no where else, and the declarace of

"x_url" => "FALSE",

but X-Url is undocumented in the actail AIM manual, anyone else else have any exp with AIM?

Reply With Quote
  #2  
Old May 19th, 2005, 05:10 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Authoirze.net

I am really new to PHP and am working with this same script provided by Authorize.net. I need help with the page that it directs the browswer to upon success or failure of charge. Any help on what code I need to change would be greatly appreciated. Thanks.

Reply With Quote
  #3  
Old May 19th, 2005, 05:12 PM
jbhardman jbhardman is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Pleasant Grove, UT 84062
Posts: 5 jbhardman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Authoirze.net

That first reply was me, I just registered. Thanks for any help received.

Reply With Quote
  #4  
Old May 19th, 2005, 08:39 PM
LLX LLX is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,121 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 43 m 44 sec
Reputation Power: 3
Send a message via AIM to LLX Send a message via Yahoo to LLX
RE: Authoirze.net

thats how iedited it, i completed out basicly anything i didnt want to bounce back in AIM the submit page is the bounce back page only SIM uses a relay url, look over my code modify to fint your needs

php Code:
Original - php Code
  1.  
  2. <?php
  3.  include ('celebrityData.php'); // authoize.net user/trankey and pw
  4.  include ('SQLcon.php');// my connctio nsettings
  5.  
  6.  $ID_KEY = $_POST['x_cust_id'];
  7.    $EQuerry = mysql_query("SELECT Event_ID, Workshop_Date FROM  EventCalanderMembers WHERE EveID = ' $ID_KEY'") or die(mysql_error());
  8.  $EQnews=mysql_fetch_assoc($EQuerry);
  9.   $EventKey = $EQnews['Event_ID'];
  10.   $EventWorkshopKey = $EQnews['Workshop_Date'];
  11.  
  12.    $result = mysql_query("SELECT Event_Dates FROM  EventsList WHERE Event_ID = '$EventKey'") or die(mysql_error());
  13. $news=mysql_fetch_assoc($result);
  14.  
  15. $days = explode (',', $news['Event_Dates']);
  16. $studentMax = array (0);
  17. $numDays = count($days);
  18.  
  19. for ($i=0; $i< $numDays; $i++){
  20. $studentMax[$i] = explode (':', $days[$i]);
  21. }//end for
  22. $numDaysMax = count($studentMax);
  23.  
  24. for ($i=0; $i < $numDaysMax; $i++){
  25. if ($EventWorkshopKey == $studentMax[$i][0]){
  26. $CurDateStu = $EventWorkshopKey;
  27.     $CurStuQuery = mysql_query("SELECT Workshop_Date FROM  EventCalanderMembers WHERE Workshop_Date = '$CurDateStu'") or die(mysql_error());
  28. $Dates_used_here = mysql_num_rows($CurStuQuery);
  29. $dates_avail = $studentMax[$i][1]-$Dates_used_here;
  30. if ($dates_avail > 0){
  31.  
  32.  //the processing form
  33. $auth_net_login_id      = $loginid;
  34. $auth_net_tran_key      = $txnkey;
  35.  
  36. $relay_url = "https://www.celebrity-institute.com/WorkshopCPS/response.php";
  37. // $auth_net_url                = "https://certification.authorize.net/gateway/transact.dll";
  38. //  Uncomment the line ABOVE for shopping cart test accounts or BELOW for live merchant accounts
  39.   $auth_net_url    = "https://secure.authorize.net/gateway/transact.dll";
  40.  
  41. $sql1 = mysql_query("SELECT * FROM EventsStudents WHERE User_Name='$user'");
  42. $foo=mysql_fetch_assoc($sql1);
  43.  
  44. $authnet_values    = array
  45. (
  46.     "x_login"            => $auth_net_login_id,
  47.     "x_version"    => "3.1",
  48.     "x_email_customer" => "TRUE",
  49.      "x_merchant_email" => "info@celebrity-insititute.com",
  50.     "x_delim_char"      => "|",
  51.     "x_delim_data"      => "TRUE",
  52. //  "x_relay_url"     => $relay_url,
  53.     "x_relay_url"               => "FALSE",
  54.     "x_password"                   => $password,
  55.     "x_type"                => "AUTH_CAPTURE",
  56.     "x_method"        => "CC",
  57.     "x_tran_key"         => $auth_net_tran_key,
  58.     "x_relay_response"  => "FALSE",
  59.     "x_card_num"            => $_POST["x_card_num"],
  60.     "x_exp_date"            => $_POST["x_exp_date"],
  61.     "x_card_code"         => $_POST["x_card_code"],
  62.     "x_description"   => $_POST["x_description"],
  63.     "x_amount"        => $_POST["x_amount"],
  64.     "x_test_request"     => $_POST['x_test_request'],
  65.  
  66.     "x_cust_id"     => $_POST['x_cust_id'],
  67.     "x_first_name"     => $foo['First_Name'],
  68.     "x_last_name"     => $foo['Last_Name'],
  69.     "x_email"     => $foo['email'],
  70.     "x_city"     => $foo['city'],
  71.     "x_state"     => $foo['state'],
  72.     "x_zip"     => $foo['zip'],
  73. //  "x_Country"     => $foo['country'],
  74.     "x_address"     => $foo['address'],
  75.  
  76. );
  77.  
  78. $fields = "";
  79. foreach( $authnet_values as $key => $value ) {
  80.     $fields .= "$key=" . urlencode( $value ) . "&";
  81. }
  82.  
  83. echo "<hr>";
  84. ///////////////////////////////////////////////////////////
  85.  
  86. $ch = curl_init($auth_net_url); // URL of gateway for cURL to post to
  87. curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
  88. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
  89. curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $fields, "& " )); // use HTTP POST to send form data
  90.   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
  91. $resp = curl_exec($ch); //execute post and get results
  92. curl_close ($ch);
  93.  
  94. //echo "<b>04: Parse the results string into individual, meaningful segments:</b><br>";
  95.  
  96. echo "<table cellpadding="5" cellspacing="0" border="0">";
  97.  
  98. $text = $resp;
  99. $h = substr_count($text, "|");
  100. $h++;
  101.  
  102.  
  103.  
  104.  
  105. //  for($j=1; $j <= $h; $j++){
  106.     for($j=1; $j <= 1; $j++){
  107.  
  108.     $p = strpos($text, "|");
  109.  
  110.     if ($p === false) { // note: three equal signs
  111. /*
  112.         echo "<tr>";
  113.         echo "<td class="e">";
  114.             //  x_delim_char is obviously not found in the last go-around
  115.             if($j>=69){
  116.                 echo "Merchant-defined (".$j."): ";
  117.                 echo ": ";
  118.                 echo "</td>";
  119.                 echo "<td class="v">";
  120.                 echo $text;
  121.                 echo "<br>";
  122.             } else {
  123.                 echo $j;
  124.                 echo ": ";
  125.                 echo "</td>";
  126.                 echo "<td class="v">";
  127.                 echo $text;
  128.                 echo "<br>";
  129.             }
  130.         echo "</td>";
  131.         echo "</tr>";
  132. */
  133.     }else{
  134.  
  135.         $p++;
  136.  
  137.         //  We found the x_delim_char and accounted for it . . . now do something with it
  138.  
  139.         //  get one portion of the response at a time
  140.         $pstr = substr($text, 0, $p);
  141.  
  142.         //  this prepares the text and returns one value of the submitted
  143.         //  and processed name/value pairs at a time
  144.         //  for AIM-specific interpretations of the responses
  145.         //  please consult the AIM Guide and look up
  146.         //  the section called Gateway Response API
  147.         $pstr_trimmed = substr($pstr, 0, -1); // removes "|" at the end
  148.  
  149.         if($pstr_trimmed==""){
  150.             $pstr_trimmed="NO VALUE RETURNED";
  151.         }
  152.  
  153.