kevinlwz Posted May 3, 2007 Share Posted May 3, 2007 Can Any one help me to add new payment gateway in Oscomerce . How can i do? >_< Thanks~~~ **************************** Credit Card code: *********************************** To connect osCommerce to the online payment page, the following codes are added to 2 files of osCommerce, which are checkout_process.php and checkout_success.php. 1. Changes made to checkout_process.php The file is located at <osCommerce root folder>\catalog\checkout_process.php At the very end of the file, find the following code: tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, ‘’, ‘SSL’)); Replace this line of code by the following code: ?> <html> <body onLoad="payForm.submit();"> <?php //translating credit card type $ccType = $order->info['cc_type']; if ($ccType =="Visa") $ccType = "VISA"; else if ($ccType =="Master Card") $ccType = "Master"; else if ($ccType =="Diners Club") $ccType = "Diners"; else if ($ccType =="American Express") $ccType = "AMEX"; else if ($ccType =="JCB") $ccType = "JCB"; //translating year $tempYear = "2000" + substr($order->info['cc_expires'],2,4); //translating currency if ($order->info['currency']=="USD") // American Dollar $currCode = 840; else if ($order->info['currency']=="HKD") // Hong Kong Dollar $currCode = 344; //***You can add code for currencies other than USD and HKD Xyz PayGate Integration Guide (For osCommerce) Page 10 //***Here are some code for other currencies : //**************************************** // else if ($order->info['currency']=="SGD") //Singapore Dollar Payment Asia (International) Limited 9/F., 2 Austin Avenue, Tsim Sha Tsui, Kowloon, Hong Kong Tel: 3105 8028 Fax: 2670 1028 Email: [email protected] // $currCode = 702; // else if ($order->info['currency']=="CNY(RMB)") // Chinese Renminbi Yuan // $currCode = 156; // else if ($order->info['currency']=="JPY") // Japanese Yen // $currCode = 392; // else if ($order->info['currency']=="TWD") // New Taiwan Dollar // $currCode = 901; //**************************************** $form_action_url ='https://www.xyz.com/b2c2/eng/dPayment/payComp.jsp'; echo tep_draw_form('payForm', $form_action_url, 'post'); ?> <input type="hidden" name="merchantId" value= "1"> <!-- merchantId here is set to 1 for testing purpose --> <input type="hidden" name="amount" value= "<?php echo $order->info['total']?>"> <input type="hidden" name="orderRef" value= "<?php echo $insert_id?>"> <input type="hidden" name="currCode" value= "<?php echo $currCode?>"> <input type="hidden" name="pMethod" value= "<?php echo $ccType?>"> <input type="hidden" name="cardNo" value= "<?php echo $order->info['cc_number']?>"> <input type="hidden" name="cardHolder" value= "<?php echo $order->info['cc_owner']?>"> <input type="hidden" name="epMonth" value= "<?php echo substr($order->info['cc_expires'],0,2)?>"> <input type="hidden" name="epYear" value= "<?php echo $tempYear?>"> <input type="hidden" name="payType" value= "N"> <input type="hidden" name="successUrl" value= "http://www.yourdomain.com/catalog/checkout_success.php?result=1"> <input type="hidden" name="failUrl" value= "http://www.yourdomain.com/catalog/checkout_success.php?result=3"> <input type="hidden" name="cancelUrl" value= "http://www.yourdomain.com/catalog/checkout_success.php?result=2"> <input type="hidden" name="lang" value= "E"> </body> </html> <?php These codes are used to connect osCommerce to the Online Payment page and transfer payment data such as credit card number and payment amount to the Online Payment page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.