I fiddled around for hours last night and have got Nochex Checkout working (see my draft cart: http://www.secretshop.co.uk/QuickCart)
Feel free to play around with it, I wont take any orders seriously. If you press the pay with Nochex button you will see that the Nochex Checkout displays the amount and the order reference number.
The only problems I have are:
there are now 2 submit buttons on the orders_delivery page, one to submit the order to the site and one to submit the order to the Nochex Checkout, and once one is pressed you can't go back and submit the other.
Secondly, for some reason I can only get the Nochex form to read the basket amount BEFORE delivery is added.
Hopefully someone out there will know a way around these problems.
I will tidy up my code in the next few days and paste some here for people try themselves.
Hope I have been of some help and that this makes sense to you all!
Thanks Jo
Jo
2005-11-05 18:34
Ok, after a bit more playing around I have now got the code working without the problem of the 2 submit buttons.
Now the customer goes through the cart as usual, presses the send button to submit the order to the site, goes through to the orders_saved page and chooses their payment processor (so far I have only included Paypal and Nochex).
So please go to http://www.secretshop.co.uk/QuickCart and place an order (I will not process it) to try it out and let me know what you think / if you have any problems etc.
Jo
Jo
2005-12-05 15:29
For anyone visting the above link - at the moment there is an error regarding telephone number which I have fixed in my new version of QuickCart at SecretShop.co.uk (please dont place test orders there though).
If you still want to test it at SecretShop.co.uk/QuickCart, feel free but ignore the telephone error!
Thanks.
P.S - If anyone wants more info on how I added the Paypal and Nochex payment options to the cart feel free to ask.
rubdub
2005-12-06 11:00
Hey Jo I tested your mod out and it works great. I'd love to know how you did it.
Jo
2005-12-08 02:38
Hi,
Basically, to add Paypal and Nochex to the cart I edited the orders_saved.tpl file (in templates/default). The following code works but it doesnt include the delivery charge for some reason. If it doesnt work or if someone knows how to add the delivery please let me know!
Here is the full code to paste into orders_saved.tpl (dont forget to change the email addresses and return url's in the forms):
<style type="text/css"> <!-- .style3 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; } .style4 { font-size: 12px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #669933; } .style5 {color: #000000} --> </style> <table cellspacing='0' align='left'> <tr> <td colspan='2' style='padding: 5px;' class='h1'> $lang[Order] - Payment </td> </tr> </table> <p> </p> <table class="operation table" width="441" border="0" align="center" cellpadding="10" cellspacing="0"> <tr bgcolor="#DACFE0"> <td width="201" valign="top" class='ok'> $lang[Order_finished] </td> <td width="200"> After making payment you will be returned to this website </td> </tr> <tr bgcolor="#DACFE0"> <td colspan="2">As you have already given us your address details there is no need to fill in these sections whilst using the secure Nochex checkout, however, you may do so if you wish. </td> </tr> </table> <div align="center"><br> </div> <br> <br> <table width="441" border="0" align="center" cellpadding="4" cellspacing="0"> <tr bgcolor="#669933"> <td height="29" bgcolor="#669933"><span class="style3">Pay with PAYPAL:</span></td> <td><span class="style3">Pay with NOCHEX: </span></td> </tr> <tr bgcolor="#F3F3F3"> <td width="210"><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <div align="center"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="youremail@yourdomain.co.uk"> <input type="hidden" name="item_name" value="Payment - www.yourdomain.co.uk"> <input type="hidden" name="item_number" value="Order ID $iOrder"> <input type="hidden" name="amount" value="$fSummary"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="GBP"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0"
name="submit" alt="Pay with PayPal"> </div> </form></td> <td width="209"><form action="https://www.nochex.com/nochex.dll/checkout" method=post> <div align="center"> <input type="hidden" name="email" size="64" value="youremail@yourdomain.co.uk"> <input type="hidden" name="amount" size="8" value="$fSummary"> <input type="hidden" name="ordernumber" size="64" value="Order ID $iOrder"> <br> <input type="hidden" name="logo" size="64"> <br> <input type="hidden" name="returnurl" size="64" value="www.yourdomain.co.uk"> <input name="image" type="image" src="http://support.nochex.com/web/images/cardsboth2.gif" alt="I accept payment using NOCHEX"> <!-- NOCHEX LOGO FINISH --> </div> </form></td> </tr> <tr bgcolor="#DDDDDD"> <td colspan="2"><span class="style4">*If you don't have a Paypal account and don't want to sign up for one, you can use Nochex to pay with UK credit or debit cards <span class="style5">without</span> becoming a member</span></td> </tr> </table> <div align="center"><br> <a href='javascript:windowNew( "?p=ordersWindowPrint&iOrder=$iOrder" );'><b>$lang[Order_print]</b></a> <br /> <br /> <a href='?p='>$lang[Homepage]</a> <br /> <br /> </td> </table> </div>
Jedi Hunter
2005-12-08 16:02
what if I'm using Authorize.net? this is a "sample code" they sent me using AIM (advanced integration method):
<html> <head> <title>AIM Example in PHP :: Authorize.Net</title>
<b>Authorize.Net<br> Advanced Implementation Method (AIM)<br> PHP Example Code</b><br> <br> This is just a test to:<br> 1) post an HTTP request to the secure Authorize.Net server<br> 2) process feedback from the secure Authorize.Net transaction DLL<br> <br>
</td> </tr> <tr class="v"> <td>
<?php
$DEBUGGING = 1; # Display additional information to track down problems $TESTING = 1; # Set the testing flag so that transactions are not live $ERROR_RETRIES = 2; # Number of transactions to post if soft errors occur
$auth_net_login_id = "CHANGE THIS"; $auth_net_tran_key = "CHANGE THIS"; $auth_net_url = "https://certification.authorize.net/gateway/transact.dll"; # Uncomment the line ABOVE for shopping cart test accounts or BELOW for live merchant accounts # $auth_net_url = "https://secure.authorize.net/gateway/transact.dll";
echo "<b>01: Post the transaction (see the code for specific information):</b><br>";
$ch = curl_init("https://certification.authorize.net/gateway/transact.dll"); // URL of gateway for cURL to post to curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $fields, "& " )); // use HTTP POST to send form data ### curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. ### $resp = curl_exec($ch); //execute post and get results curl_close ($ch);
// x_delim_char is obviously not found in the last go-around
if($j>=69){
echo "Merchant-defined (".$j."): "; echo ": ";
echo "</td>"; echo "<td class=\"v\">";
echo $text; echo "<br>";
} else {
echo $j; echo ": ";
echo "</td>"; echo "<td class=\"v\">";
echo $text; echo "<br>";
}
echo "</td>"; echo "</tr>";
}else{
$p++;
// We found the x_delim_char and accounted for it . . . now do something with it
// get one portion of the response at a time $pstr = substr($text, 0, $p);
// this prepares the text and returns one value of the submitted // and processed name/value pairs at a time // for AIM-specific interpretations of the responses // please consult the AIM Guide and look up // the section called Gateway Response API $pstr_trimmed = substr($pstr, 0, -1); // removes "|" at the end
if($pstr_trimmed==""){ $pstr_trimmed="NO VALUE RETURNED"; }
case 14: echo "Cardholder First Name (x_first_name): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 15: echo "Cardholder Last Name (x_last_name): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 16: echo "Company (x_company): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 17: echo "Billing Address (x_address): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 18: echo "City (x_city): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 19: echo "State (x_state): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 20: echo "ZIP (x_zip): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 21: echo "Country (x_country): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 22: echo "Phone (x_phone): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 23: echo "Fax (x_fax): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 24: echo "E-Mail Address (x_email): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 25: echo "Ship to First Name (x_ship_to_first_name): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 26: echo "Ship to Last Name (x_ship_to_last_name): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 27: echo "Ship to Company (x_ship_to_company): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 28: echo "Ship to Address (x_ship_to_address): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 29: echo "Ship to City (x_ship_to_city): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 30: echo "Ship to State (x_ship_to_state): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 31: echo "Ship to ZIP (x_ship_to_zip): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 32: echo "Ship to Country (x_ship_to_country): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 33: echo "Tax Amount (x_tax): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 34: echo "Duty Amount (x_duty): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 35: echo "Freight Amount (x_freight): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 36: echo "Tax Exempt Flag (x_tax_exempt): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 37: echo "PO Number (x_po_num): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 38: echo "MD5 Hash: ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
case 39: echo "Card Code Response: ";
echo "</td>"; echo "<td class=\"v\">";
$fval=""; if($pstr_trimmed=="M"){ $fval="M = Match"; }elseif($pstr_trimmed=="N"){ $fval="N = No Match"; }elseif($pstr_trimmed=="P"){ $fval="P = Not Processed"; }elseif($pstr_trimmed=="S"){ $fval="S = Should have been present"; }elseif($pstr_trimmed=="U"){ $fval="U = Issuer unable to process request"; }else{ $fval="NO VALUE RETURNED"; }
echo $fval; echo "<br>"; break;
case 40: case 41: case 42: case 43: case 44: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 55: case 56: case 57: case 58: case 59: case 60: case 61: case 62: case 63: case 64: case 65: case 66: case 67: case 68: echo "Reserved (".$j."): ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>"; break;
default:
if($j>=69){
echo "Merchant-defined (".$j."): "; echo ": ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>";
} else {
echo $j; echo ": ";
echo "</td>"; echo "<td class=\"v\">";
echo $pstr_trimmed; echo "<br>";
}
break;
}
echo "</td>"; echo "</tr>";
// remove the part that we identified and work with the rest of the string $text = substr($text, $p);
what do I need to change in order to make this work?
Jedi Hunter
2005-12-08 16:26
will QC even work with Authorize.Net?
Newbie
2005-12-13 13:48
I'm no php programmer but surely you should be able to set your array up to reflect the variables from QC . . . . ie:
you would change
"x_amount" => "12.23", to "x_amount" => "$fSummary", etc etc
I imagine you have a link like Jo above to select your payment gateway and then all the relevant variables are carried forward to your Authorize page where you set the corresponding array up??? Does that sort of make sense???
I know what I mean but it's slightly harder to actually explain it :-o
Any php guru out there who could shed a bot more light on the subject??
I originally made my post in the wrong topic. But here it is anyway:
I'm using QC 1.2, but im yet to get nochex working. Could anyone please offer me some help as to how to get nochex working with 1.2?
Any help would be very much appreciated. Thank you.
~Jo
2006-06-27 19:13
Hi,
I got Paypal and Nochex working with v0.3.1. See here > http://www.secretshop.co.uk/QuickCart_1
Feel free to make a test order, nothing will be processed.
The details are above on how I got that working. I haven't tried it in v1.2 yet but it's definitely worth a try because it worked great with v0.3.1 (apart from the page jumping to the right after checkout but that's probably just something silly I've done and hopefully wont happen to others!)
~Jo
2006-06-27 19:23
Reading back, I have just realised there's no "orders_saved.tpl" in v.1.2 but there might be an equivalent file to paste the code into...
Anyone got any ideas? I'm having a look now but it might take me a while to figure it out!
Karl19
2006-07-12 16:10
Hi Jo,
Did you find a way to add NoChex with version 1.2 (or 1.3)? I'm just about to get stuck into QuickCart as I need a small cart for a client, but one of the requirements is for NoChex to work.
Would be intereting to hear your progress.
Thanks, karl
Jo
2006-07-20 23:42
Hi there,
Yes I got it working after a little playing around and thanks to Ste707 for posting how to add Paypal as it's basically the same as that - see this thread:
Obviously, don't forget to change the email address and domain etc. to your own. I hope that works for everyone and that these instructions make sense!
Thanks, Jo
Jo
2006-08-31 15:22
UPDATE: anyone using QCLoaded v1.3 with Paypal code added, see this thread (it might save you some frustration!):