Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal IPN and PWA


Guest

Recommended Posts

I have running searches for several hours and cannot find a post so far (I will continue my search) related to this which has a reply that is in any way useful, if answered at all.

I have PayPal IPN installed and I'm trying to install PWA and have encountered a snag when merging the chechout_success.php files.

 

When trying to merge the files, I have this code in the PWA version of checkout_success.php:

//    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
// Added a check for a Guest checkout and cleared the session - 030411 
if (tep_session_is_registered('noaccount')) { 
tep_session_destroy(); 
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL')); 
} 
else { 
tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string, 'SSL')); 
}

 

And in MY checkout_success.php, with Paypal IPN installed, this section reads:

//begin PayPal_Shopping_Cart_IPN
    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
  } else if ((isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'success')) {
    PayPal_osC::reset_checkout_cart_session();

How do I safely combine these so that everything will still be handled properly?

I would like to make sure I do this is correctly as I'm pretty much just at a "cut and paste" level.

Any help with this or just a link to the correct area would make my day.

Thanks in advance

Link to comment
Share on other sites

I forgot to include in the previous post:

I'm currently running:

OSCommerce 2.2 MS 2

PWA 0.82

Paypal_Shopping_Cart_IPN v 3.1.5

and a few other misc. contribs.

 

After a few more hours of searching I finally found one possible solution. I haven't tested it yet as I have a few more things to get done today.

 

 if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);

// PWA Added a check for a Guest checkout and cleared the session - 030411
if (tep_session_is_registered('noaccount')) {
tep_session_destroy();
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'));
}
else { //end of pwa addition
  //begin PayPal_Shopping_Cart_IPN
   tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string)); }
 } else if ((isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'success')) {
   PayPal_osC::reset_checkout_cart_session();
 }
//end PayPal_Shopping_Cart_IPN
//}

 

I found it here

 

Any other suggestions for more recent solutions are still appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...