Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

FirePay Payment module.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-08-2003, 01:20 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default FirePay Payment module.

Okie I had this laying around from awhile back if anyone wants to use www.firepay.com (similar to paypal but Canada based) Here is my payment module for them, keep in mind it was written on 9-20-2002 so it may need revamping.

This module was written with 3.1.3a, and may need revamping for later releases.

Code:
<? # # FirePay CC processing module # # written by www.molotovbliss.com on 9-20-2002 # released: 1-8-2003 # require "../include/payment_method.php"; # # Filling $_location variable depending protocol value # $module_params = func_query("SELECT param01, param02, param03 FROM ccprocessors WHERE processor = 'cc_firepay.php'"); $firepay_merchantid = $module_params[0]["param01"]; $firepay_account = $module_params[0]["param02"]; $firepay_pwd = $module_params[0]["param03"]; #print "$firepay_merchantid, $firepay_account, $firepay_pwd"; exit; $res = func_query("SELECT protocol FROM payment_methods WHERE payment_script = 'payment_firepay.php'"); if ($res["protocol"] == "https") $_location = $https_location; else $_location = $http_location; # # FirePay Request # if ($REQUEST_METHOD == "POST" && !empty($payment_type)) { print "hi"; exit; $str = ""; foreach ($HTTP_POST_VARS as $key => $val) $str .= "-$key=\"$val\" "; exec ("./firepay.pl $str", $bill_output); list($bill_errorcode, $bill_message) = explode(",", $bill_output[0]); if ($bill_errorcode != 1) { $bill_mesage = "Status: $payment_status Reason: $pending_reason"; header("Location: ../customer/error_message.php?error=error_ccprocessor_error&bill_message=".urlencode($bill_message)); exit; } else { $orderids = func_place_order("$payment_method (FirePay)", "P", ""); $_orderids = func_get_urlencoded_orderids ($orderids); # # Remove all from cart # $cart = ""; header("Location: ../customer/cart.php?mode=order_message&orderids=$_orderids"); exit; } } # # Create 'Not finished' order entry # #$orderid = func_place_order($payment_method, "N",""); #if($mode=="success" && $secureid && $secureid==$order_secureid) { # $orderids = func_place_order($payment_method, "P",""); # $_orderids = func_get_urlencoded_orderids ($orderids); # # Remove all from cart # # $cart=""; # header("Location: $http_location/customer/cart.php?mode=order_message&orderids=$_orderids"); # exit; #} # # Below is the form for POST method # ?> <html> <body> <form action="https://realtime.test.firepay.com/servlet/DPServlet" method="post" name=firepay_form> <input type=hidden name=clientVersion value="1.1"> <input type=hidden name=cvdIndicator value="0"> <input type=hidden name=operation value="P"> <input type=hidden name=mechantId value="<? echo $firepay_account ?>"> <input type=hidden name=mechantPwd value="<? echo $firepay_pwd ?>"> <input type=hidden name=mechantTxn value="<? echo $order_secureid ?>"> <input type=hidden name=cardNumber value="<? echo $userinfo["card_number"] ?>"> <input type=hidden name=cardExp value="<? echo $userinfo["card_expire"] ?>"> <input type=hidden name=cardType value="<? echo substr($userinfo["card_type"], 0, 2) ?>"> <input type=hidden name=amount value="<? print (int) ($cart["total_cost"] * 100) ?>"> <input type=hidden name=custName1 value="<? echo addslashes($userinfo["firstname"])." ".addslashes($userinfo["lastname"]) ?>"> <input type=hidden name=streetAddr value="<? echo addslashes($userinfo["b_address"]) ?>"> <input type=hidden name=city value="<? echo $userinfo["b_city"] ?>"> <input type=hidden name=state value="<? echo $userinfo["b_state"] ?>"> <input type=hidden name=zip value="<? echo $userinfo["b_zipcode"] ?>"> <input type=hidden name=phone value="<? echo $userinfo["phone"] ?>"> <input type=hidden name=country value="<? echo $userinfo["b_country"];?>"> </form> <table width=100% height=100%> <tr><td align=center valign=middle>Please wait while connecting to FirePay payment gateway...</td></tr> </table> </body> </html>

You will need to add a payment module to the x-cart_ccprocessors database as well as create a .tpl file for the admin area to fill in the param's required, I don't have the .tpl anymore but can be created for you as well as the SQL statement for inserting the processor into the database if you wish, feel free to contact me.

If you find this file useful Please, please, please make a donation to me as this is time and money I'm loosing if your just blantaly taking the code and using it for your own profit!

Happy x-carting!
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:42 AM.

   

 
X-Cart forums © 2001-2020