Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Empty shopping cart upon checkout success


hungryhippo8

Recommended Posts

Posted

Hi there,

 

I'm having problems with the checkout of my store:

 

www.lemonpets.com/index.php

 

I've installed the "Fast Easy Checkout" contribution and nothing more. Everything works fine, the credit card gets processed, transaction is completed. Then, upon redirect back to the site, it goes to an empty shopping cart instead of checkout_success.php.

 

I guess this is probably due to the loss of session data between the transfer from my site -> 3rd party processor -> bank (e.g. Verified by Visa site) -> my site

 

The processor I use is Paydollar and it has basic support of OSC. In checkout_process.php, I commented out this line:

 

---------------------------------------------------------------------------------

LINE 307 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, ??, ?SSL?));

with:

 

?>

<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=

"

<input type="hidden" name="failUrl" value=

"

<input type="hidden" name="cancelUrl" value=

"

<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

?>

--------------------------------------------------------------------------------------------

 

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 and I opted not to. I know, WTF, right? However, it's the only choice I have since I needed a processor that deals with Hong Kong dollar and banks.

Posted

I'm not too sure whats going on here....

 

Firstly, why haven't you posted this to the fast easy checkout thread?

 

As far as I am aware it is up to the 'payment module' to re-direct your customers back to a page of your choice.

 

Example: If you use the standard paypal module then it is in the paypal module page where it re-directs you to 'checkout process'... if you are using an internet merchant then the module you have installed for that merchant will tell it where to re-direct when the payment has been processed

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...