Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal IPN - Order Total in database and emails


yelir

Recommended Posts

Hi,

 

I've installed PayPal IPN 0.981 on 2 OsCommerce installations (Thanks to the contributor who made this, it will save a lot of hassle).

 

My only problem is the order total entered into the database, and sent in the order email is incorrect (The customer is still charge correctly luckily). Does anyone else have this problem and know how to fix it?

 

I've never done PHP, but from looking at the code it appears an order_total object is never created in paypal_notify.php (as in checkout_process). I'm not sure where all the database updates are done by this contribution, is it done here?

 

On another note, is there anywhere in the support forums or elsewhere, where a general code overview can be found for various contributions, ie what each file is supposed to etc. This would be helpful to figure out these bugs...

 

Thanks very much ahead of time for any help :)

Link to comment
Share on other sites

As a test for this 'particular' contribution,

Purchase a full price product on your site, when you click the confirmation order button (on your website), you will then be taken to PayPal's website.

When PayPal displays their intial page look in the url and you will the parameters pertaining to your order, key across until you see item_price, now change the price to 0.01, now hit enter, PayPal will now reload itself, now look at the amount that PayPal is now requesting you pay for the item you are purchasing. Login and and pay the 0.01, follow the PayPal proccess through and click the continue button, which then returns you to your site. You will be greeted with a thank you msg, now check your account history, according to your website you have paid the full asking price. Now check the order in osC admin, again it would seem that the customer has paid the full asking price. But you know that you only paid 0.01 via PayPal.

 

There is a solution.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hi, thanks for the response and tip.

 

My problem is not testing tho, but that will be helpful.

 

The problem I'm having is that in the customer email, the order total is not showing up. Another problem is that in the admin area, the order is not showing up on a basic order search. It does show up if I search by order ID, but only the product price, not the total price (shipping, etc).

 

I've done some more research on this. The orders_total table is getting an invalid entry - the row for this order has a value of 0.0 and a no class. Based on this I'm guessing the order total is not being calculated correctly in checkout_paypalipn.php.

 

Does anyone know what might be causing this? Are others having this problem?Thanks again ahead of time...

Link to comment
Share on other sites

Hi there,

 

If I were you I'd uninstall that contribution, I had a quick look at the code to see what might be happening with respect to the order total, basically in the original version osC version a call is made to a class called order_totals.

 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();

And in that contribution it only seems to use the 'order' class which is different, I would have to look further to see what that would do, but because the 'order' class hasn't been included in contribution files, suggests there has not been any change, if so, then why wouldn't the original osC version just do that (i.e use 'order' instead of 'order_total')?

 

I think if you run the test suggested above you'd understand the point I was trying to make earlier also.

 

If you look for PayPal_Shopping_Cart_IPN you will find that this contribution has not really made any radical changes to the osC default version, so it should function as normal. I sort of know this, because I wrote it, but didn't want to give the wrong impression.

 

All the best.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hi,

 

Thanks again for the reply. Sorry I missed the initial point of the first post. So you mean with your contribution, the price cannot be changed?

 

I realized the price could be changed with the IPN contribution I am using but thought there was no way around that, I would have to double check with PayPal?

 

I did further research into this contribution and it actually inserts a blank order total (in checkout_paypalipn.php), and as far as I can see, never updates it.

 

I only used that contribution because it seemed like what most people were using. Does your contribution work the same as that one (except insert totals correctly ;) )

 

Thanks

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