PHP - Authorize.net
I've hit a six-foot-thick brick wall and have no idea what to do. Trying to integrate for payments and this is a scary new realm for me
Hopefully somebody here can help me figure this out, as I'm a complete and utter newbie on shopping carts etc. Authorize.net has been no help, and they say "we have no developers" on staff to answer questions. I'm getting an error 13 and nothing gets around it. The basic result is that an error 13 occurs when the API id and transaction key are incorrect (but they are) or if the 'gateway URL' is incorrect. I've checked and it is. But they also say its in the in the cURL section of the code and if this is wrong, it could generate the error. No idea where that's supposed to be. did a search. Question: To install, test, etc, it looks like I need something called cURL extensions and SimpleXML enabled. I don't know if this is, and the client's hosting company has not gotten back to me (hosted out of country, too). I looked for a php.ini file, and see nothing. Is it safe/possible to put my own php.ini file on the html_public folder? If so, how do I set up the cURL and SimpleXML extensions? (Assuming this is even contributing to the problem) And any help beyond this is greatly appreciated, if you've worked with authorize.net integration. Similar TutorialsI'm looking to build my own ecommerce site and i just looked at their sample code to test transactions. See below. Code: [Select] <?php require_once 'anet_php_sdk/AuthorizeNet.php'; // Make sure this path is correct. $transaction = new AuthorizeNetAIM('YOUR_API_LOGIN_ID', 'YOUR_TRANSACTION_KEY'); $transaction->amount = '9.99'; $transaction->card_num = '4007000000027'; $transaction->exp_date = '10/16'; $response = $transaction->authorizeAndCapture(); if ($response->approved) { echo "<h1>Success! The test credit card has been charged!</h1>"; echo "Transaction ID: " . $response->transaction_id; } else { echo $response->error_message; } ?> I was under the impression handling credit cards was MUCH harder to deal with. Couldn't you just store the $_POST['creditcardnumber'] in a database(not very secure AT ALL)? I would of thought they would have to make you mess with the form submission so their card number is encrpted through the $_POST and Authorize.net is the only one that has the decryption key. Also, doesn't like EVERY credit card processing form require the name on the card? Am i missing something?? 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' : Code: [Select] 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? Code: [Select] <?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"; |