Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

hungryhippo8

Archived
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Real Name
    Peter Chan

hungryhippo8's Achievements

  1. Gotcha Frank. Thanks and keep up the good work! :thumbsup:
  2. Thanks for the reply Frank. I'm new to PHP so I'll have to sift through the payment modules to see if I can learn anything from them. I know it's beyond the scope of FEC, but do you have any suggestions on this? Thanks! Peter
  3. Hi guys, First off, thanks nana for the great contribution. I installed it, works fine until I tried to incorporate my site with a 3rd party processor. The payment still gets processed, but I believe the session is lost during the transfer between sites (ie. my site -> 3rd party processor -> bank (e.g. Verified by Visa site) -> my site). Therefore, after the payment has been received/rejected/cancelled I would be transferred to an empty shopping cart (probably because of entering a new session and being redirected to checkout_success.php). The CC processor I use is Paydollar, and it supports OSC. Here's what I did to use their service. In checkout_process.php, I commented out this line: LINE 307 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, ??, ?SSL?)); Then added: ?> <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 //***Here are some code for other currencies : //**************************************** // else if ($order->info['currency']=="SGD") //Singapore Dollar // $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.paydollar.com/b2c2/eng/dPayment/payComp.jsp'; echo tep_draw_form('payForm', $form_action_url, 'post'); ?> <input type="hidden" name="merchantId" value= "xxxx"> <!-- 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.lemonpets.com/checkout_success.php?result=1"> <input type="hidden" name="failUrl" value= "http://www.lemonpets.com/checkout_success.php?result=3"> <input type="hidden" name="cancelUrl" value= "http://www.lemonpets.com/checkout_success.php?result=2"> <input type="hidden" name="lang" value= "E"> </body> </html> <?php Then, the following code is added to checkout_success.php: <?php $result = $HTTP_GET_VARS['result']; if ($result == 2){ //payment is cancelled ?> <td valign="top" class="main"> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?> <div align="center" class="pageHeading"> <?php echo "Your order has been cancelled"; ?> </div><br> <?php echo "You are welcome to make another order."; ?><br><br> <?php }else if ($result == 3){ //payment is rejected ?> <td valign="top" class="main"> <?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?> <div align="center" class="pageHeading"> <?php echo "Your order has been rejected by the bank."; ?> </div><br> <?php echo "The bank has rejected your order since payment information provided is invalid."; ?><br><br> <?php }else if ($result == 1){ //result is successful ?> Being new to PHP and not knowing what to do, I tried to change the success and fail URL to something like: tep_href_link('checkout_success.php?result=1') It does the same thing, but returns with a new session ID instead of just the cart being empty. That being said what I would like to know if it's beyond my control since the payment process is redirected to several other sites. If it is possible to correct this, then I'd appreciate any help that I can get. Many thanks in advance. Peter P.S. Don't try to make a transaction on the site because it is LIVE. Paydollar actually charges you to have a testing server :blink: and I opted not to. However, it's the only choice I have since I needed a processor that deals with Hong Kong dollar and banks.
×
×
  • Create New...