Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official PayPal IPN Support Thread


Mark Evans

Recommended Posts

First off thanks for this wonderful contribution.

 

I have one problem. On the checkout_confirmation.php page I get the following error.

 

Fatal error: Call to undefined method: currencies->get_decimal_places() in /home/content/........./shop/catalog/includes/modules/payment/paypal_ipn.php on line 450

 

I am using PayPal IPN v2.3.4.6.

 

 

I have spent hours and hours on this and can't figure out what is wrong. It worked until last thursday. I haven't changed anything in the store which is odd. I have found that all my problems occur after changing something. I am the only one who edits this site and I can't figure out what happened.

 

If anyone can help me that would be great.

 

 

 

Here is the chunk of code. Line 450 is 3rd line of code in this code (I separated it with spaces on each side).

 

 // BOF shipping & handling fix by AlexStudio
       if(MOVE_TAX_TO_TOTAL_AMOUNT == 'True') {

$parameters['amount'] = number_format(($subtotal + $order->info['tax']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

       } else {
         // default
         $parameters['amount'] = number_format($subtotal * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
         $parameters['tax'] = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
       }
       if ($order->content_type != 'virtual') {
         $parameters['shipping'] = number_format($order_total['ot_shipping'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
       }
       $parameters['handling'] = number_format($order_total['ot_loworderfee'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
       // EOF shipping & handling fix by AlexStudio

 

 

Thanks again everyone. I don't post much because I find almost all my answers by searching, but I just can't find the same or similar problem anywhere else.

Edited by jaybquick
Link to comment
Share on other sites

UPDATE: I did some more trouble shooting and found that ANY paypal payment module has this issue.

 

I am beginning to thing I have an issue with my currencies.php file. I rolled it back to original versions and previous back ups with no luck.

 

If anyone can direct me to where my problem is, I would be extremely appreciative.

Link to comment
Share on other sites

Thought I would share for those who don't want to restrict shipping options for their customers.

If anyone has complaints from their customers that they are receiving an error when they are trying to purchase something from your site:

"Paypal does not allow your country of residence to ship to the country you wish" and you are using using the paypal_ipn module on your OsCommerce site.

Go to includes/modules/payment/paypal_ipn.php

Find

$parameters['address_override'] = '1';

and change the value to "0"

Customer should now be able to ship to any address even in another country.

Link to comment
Share on other sites

Fixed. I somehow put my currencies.php file from my admin side to my catalog side. That is what I get for juggling a database migration and doing mods at the same time.

 

Once again solved a problem caused by me or something I changed, which is 99% of the time the case.

 

Thanks again everyone.

Link to comment
Share on other sites

Fix for the problem where customer is redirected to the shopping cart after an order, instead of the success page (occurs when the order [valid, and in-stock] causes the stock to drop to zero after the order has been processed).

 

This is similar to wmjasonward's post "Fix for customer being sent to shopping cart instead of success page after paying at PayPal" posted to the Paypal IPN contribution http://addons.oscommerce.com/info/2679 [^] - but I couldn't get his version to work, because there are no $_GET variables returned by paypal by default. So this needs to be done, and then checked in the script.

 

 

1) Open /catalog/includes/modules/payment/paypal_ipn.php

 

Find the following line (at approx line ~530):

 

$parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

 

Replace it with the code:

 

// BOF - Stock fix to stop erroneous redirect to cart.
//$parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
     $parameters['return'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, 'stock_ignore=true', 'SSL');
// EOF

 

 

2) Open /catalog/checkout_process.php

 

Find the lines (approx line 56):

 

// Stock Check
$any_out_of_stock = false;
if (STOCK_CHECK == 'true') {

 

and change to:

 

// Stock Check
$any_out_of_stock = false;
// BOF - Stock fix to stop erroneous redirect to cart.
//if (STOCK_CHECK == 'true') {
if ((STOCK_CHECK == 'true') && ($_GET['stock_ignore'] != true)) {
// EOF

 

Couldn't see this on a quick search of the thread, so thought it may help someone.

Link to comment
Share on other sites

  • 1 month later...

When our default currency is changed from $ (USD) TO Euro the order email confirmation shows the products with the default store currency $ - the sub totals,shipping and totals are in the correct changed currency - Euros.

 

Products
------------------------------------------------------
1 x Keyrings - (Pack of 10 Assorted Colors) (KR001) = $9.82

------------------------------------------------------
Sub-Total: €7.32(EUR)
Registered International Air Mail: €5.93(EUR)
Total: €13.24(EUR)

 

 

This code seems to be pulling the default currency - ext/modules/payment/paypal_ipn/ipn.php :

$currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax']

 

Installed Version v 2.3.3.0 and tried newer ones,but with the same result.

 

Others have had this issue and I havn't seen any fixes ...anyone got a fix?

Link to comment
Share on other sites

  • 2 months later...

I found a strange issue with paypal:

 

If a customer orders products that cost £0.00 & shipping is £0.65 then paypal does not show a figure for the subtotal under products and subsequently there is no total amount and the customer cannot complete the payment.

 

If I make a product £0.01 and shipping £0.65 the totals are shown and the customer can complete the payment.

 

Sagepay does not have this issue. I think the issue is perhaps an anti-fraud thing on paypal but it is in fact quite legitimate on my site - the £0.00 products are in fact samples but I wish the customer to pay the postage.

 

Is there a fix to make this work?

 

I'm using "per item" but could the total passed be "aggregate" on products total of £0.00? Or is aggregate only for products not shipping?

 

OR, can we hide paypal as an option if products cost is £0.00 and so the customer can use an alternative working payment option?

 

My web log book says I'm installled V1.4 but I opened a file and it said V2.1 if it makes a difference.

 

Can anyone help with the snippet?

Cheers

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

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

PM me? - I'm not for hire

Link to comment
Share on other sites

Good Morning!

 

I've found a problem, and i don't know how to solve it.

I'm using OsCommerce 2.2RC2 and some older versions

and IPN 2.3.6

 

The problem is that "appears some orders without order history" and they should be on "Preparing [iPN]" or "Pending".

anyone knows about it?

 

Apart of that, there's another problem, some orders are set to "On Hold", but my setup is:

Set Preparing Order Status

Preparing [PayPal IPN]

 

Set PayPal Acknowledged Order Status

Default ==> Pending.

 

Can someone help me? It's urgent because we have more than 400 stores and PayPal Express Checkout didn't work ... (i've tried and tried...)

Edited by Darktorr
Link to comment
Share on other sites

Hey !

 

I've just taken over the admin of this OSC install from someone else, pretty new to system. Any help would be appreciated!

 

when on the Site > admin > modules > payments

Getting "Fatal error: Cannot redeclare class paypal_ipn in /home2/karmalog/public_html/includes/modules/payment/paypal_ipn.php on line 13"

across top of page

 

Using paypal_ipn.php,v 1.1.2.2

os vers osCommerce Online Merchant v2.2 RC2a

 

how do I get rid of this error? does something need to be updated?

 

thanks,

 

Adrian

Link to comment
Share on other sites

Hi I am just setting up osCommerce for the first time, but Im totally confused with PayPal setup I have installed the paypal website payments standard module and following the tips and tricks guide to set it up, however it appears I need to install this paypal_ipn module but which is the most recent version, how do i install it into osc and will it then offer customers the oppertunity to pay via paypal because it says "cash on delivery is the only payment option setup for my products". Any help is appreciated. I have cross posted this in the paypal howto also wasn't sure where the error lies.

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I am using Paypal IPN 2.3.4.7 on RC2A. All works fine except for the confirmation email sent to the sites admin. I get a copy of all other orders processed by Authorize.net etc. Is there a fix to get a confirmation emails from Paypal IPN?

 

Thanks JR

Link to comment
Share on other sites

  • 3 weeks later...

Hello experts,

 

I'm using Paypal IPN v2.3.4.7 on OSC 2.2MS2.

 

I want avoid Paypal showing the osc order_id to the customer as if it was the invoice number.

 

The reason is that while order_id will always grow, the invoice number must restart from zero every new year.

 

In order to do this I found the following solution:

 

1. change includes/modules/payment/paypal_ipn.php (aproximately line 516) from:

 

     $parameters['currency_code'] = $my_currency;
     $parameters['invoice'] = substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);
     $parameters['custom'] = $customer_id;

 

to:

 

      $parameters['currency_code'] = $my_currency;  
// We don't send the variable $parameters['invoice'] to PayPal in order to avoid it to show "Invoice ID = <osc_order_id>" to the customer....
// ...but we need anyway to send the order_id to PayPal to get it back through IPN notification later. 
// So we use the variable 'custom' to send both customer_id and order_id separated by a ";"
     $parameters['custom'] = $customer_id . ";" . substr($cart_PayPal_IPN_ID, strpos($cart_PayPal_IPN_ID, '-')+1);

 

2. change includes/ext/modules/payment/paypal_ipn/ipn.php adding the following:

 

// We need to separate $_POST['custom'] variable to order_id and customer_id
$post_invoice = substr($_POST['custom'], strpos($_POST['custom'], ";")+1);  // part of $_POST['custom'] string which comes after ';' --> order_id
$post_custom = substr($_POST['custom'], 0, strpos($_POST['custom'], ";"));// part of $_POST['custom'] string before ';' --> customer_id

 

at aproximately line 89, after:

 

   $result = curl_exec($ch);

   curl_close($ch);
 }

 

and substituting evvery occurence of:

 

$_POST['invoice'] with $post_invoice

$_POST['custom'] with $post_custom

 

in the rest of the file.

 

It seems it's working fine, but I would like an opinion from someone more expert than me about possible negative consequences.....

 

Thanks in advance for any help, opinions and suggestions !!

Link to comment
Share on other sites

  • 1 month later...

Hello, I am in need of some assistance in getting this add-on installed for a friend.

Currently, she has v2.2 RC2 running, and we are trying to resolve the issue of no order emails being sent for Paypal orders.

 

Based on the straightforward instructions with the Paypal IPN v2.3.4.7 download, I have uploaded the various php files to the respective folders:

catalog/ext/modules/payment/paypal_ipn/ipn.php

catalog/includes/languages/english/modules/payment/paypal_ipn.php

catalog/includes/languages/espanol/modules/payment/paypal_ipn.php

catalog/includes/languages/german/modules/payment/paypal_ipn.php

catalog/includes/modules/payment/paypal_ipn.php

 

I have also followed the instructions to modify the code in the general.php and shopping_cart.php files.

At this point, I go back to the payment modules of the dashboard, but I do not see Paypal IPN anywhere in this list to be installed.

I've checked and double-checked the files and code above, but I must be missing something. Am I placing these files incorrectly?

 

Any assistance would be greatly appreciated.

 

Regards,

Tracy

Link to comment
Share on other sites

  • 1 month later...

I have recently tried to upgrade from paypal standard contribution to the paypal_ipn. (2.3.4.7).

The standard module is working fine but I wanted to deal with the issues of customers not returning.

 

Everything is working fine except for:

"Please provide an amount and click update totals" on paypal.

Everything else, including the carriage and the returns are fine.

 

Reading the forum it appears to be a recurring theme, but I cant find a solution.

I've double checked my currency settings.

 

At present I'm studying the two contributions side by side, but I freely admit to being out of my depth.

 

Could somebody point me in the right direction.

 

many thanks

Link to comment
Share on other sites

I have recently tried to upgrade from paypal standard contribution to the paypal_ipn. (2.3.4.7).

The standard module is working fine but I wanted to deal with the issues of customers not returning.

 

Everything is working fine except for:

"Please provide an amount and click update totals" on paypal.

Everything else, including the carriage and the returns are fine.

 

Reading the forum it appears to be a recurring theme, but I cant find a solution.

I've double checked my currency settings.

 

At present I'm studying the two contributions side by side, but I freely admit to being out of my depth.

 

Could somebody point me in the right direction.

 

many thanks

 

 

Hi I think I just solved my problem

I was using the agregate setting with tax rolled up.

The Itemised setting works.

 

WARNING - TREAT THE AGREGATE SETTING WITH CAUTION, IT MAY BE BROKEN

or it could be an quirk in my setup?

Edited by pchelpwebshop
Link to comment
Share on other sites

  • 5 weeks later...

A Solution for the discount and quantity discount problem:

 

in paypal_ipn.php find:

 

$subtotal = $order_total['ot_subtotal'];

 

and replace with:

 

$subtotal = $order_total['ot_total']-$order_total['ot_shipping'];

 

Works really fine to me, and is the easiest way I think.

Link to comment
Share on other sites

  • 2 months later...

Hi all, I was wondering if anyone has seen this yet? Any worries???

 

https://www.x.com/content/ip-address-expansion-paypal-services

 

I'm not a programer... just a "user" of this mod and got a little worried... But, as they say, "a little" information can be dangerous...

 

 

ACTION REQUIRED: if you are using IPN (Instant Payment Notification) for Order Management and your IPN listener script is behind a firewall that uses ACL (Access Control List) rules which restrict outbound traffic to a limited number of IP addresses, then you may need to do one of the following:

• To continue posting back to https://www.paypal.com to perform IPN validation you will need to update your firewall ACL to allow outbound access to *any* IP address for the servers that host your IPN script

OR

• Alternatively, you will need to modify your IPN script to post back IPNs to the newly created URL https://ipnpb.paypal.com using HTTPS (port 443) and update firewall ACL rules to allow outbound access to the ipnpb.paypal.com IP ranges (see end of message).

Link to comment
Share on other sites

  • 1 month later...

I am installing 2.3.4.7. I am not getting notifications from paypal to ipn.php. I am getting 403 errors on the server so it seems to be access issues. Any tips on setting up .htaccess would be appreciated. Ideally I would want to only give access from the paypal servers. Paypal transactions are fine but can't get order emails sent or order status updated.

Thanks,

Link to comment
Share on other sites

I am using paypal_ipn.php,v 2.3.3.0

 

We are having a problem when some customers place a second order immediately after placing an order.

The second order will have the same order number as the previous order on the customer's invoice.

We receive the payment but there is no record of the second order in the database.

I have some customers that place multiple orders like this but only the first order will show up in the database.

This problem only shows up when they pay via Paypal.

 

Here's an example:

 

Customer John Smith comes to my shopping cart and wants to place two separate orders.

The first order is going to be shipped to himself.

John completes the first order and is given order number 2111.

After completing the first order he begins placing a second order that he will have shipped to his grandmother.

John completes the second order and is given order number 2111 for the second order as well.

I receive the payment for both orders.

However only the first order shows up in the database.

The only record of the second order is the fact that I have received payment for both orders.

 

I tried switching to POST for Return URL Behavior but the cart was still not cleared upon return.

 

I tried Auto Return and Payment Data Transfer on the paypal web site but it did not clear the cart upon return either.

 

I have tried it with a return URL in my PP account and without a return URL.

I can't see a difference.

 

I did some testing and when I pay for the first order and return to the shopping cart, the order IS recorded in the database but the items are STILL in my shopping cart.

When I pay for the second order and return to the shopping cart, the order is NOT recorded in the database but the items are CLEARED from the shopping cart.

At least that's what happened to me when I tested it.

 

I suppose I need to upgrade to a newer version or fix but the contribution page is confusing to me with some English, some German, and some out of order with the version numbers.

Link to comment
Share on other sites

  • 1 month later...

Excused for my English.

I have installed the 1.3.0.0 version of paypa_ipn.

In my site I have installed also affiliated OSC 1.8.

I have this problem:

When the customer goes to paypal goes all good.

The site generates a number of order Es. 51200 with name " waiting for pagamento".

When the customer finishes the payment l' order n 51200 changes name " payment effettuato".

The problem arrives when the customer return from paypal to ../checout_process.php

Now it comes generated a new order with number 51201.

This generates confusion for the customers.

I kindly ask to help me

Grazie

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I installed the IPN and its showing the items good on Transaction Type: Per Item

but its not sending me emails when i check out or to the customers email (I am running in sandbox) and its not updating the order status.

 

Thanks for any help.

 

PHP Version 5.2.17

 

cURL Information libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

 

osCommerce Online Merchant v2.2 RC2a

 

PayPal IPN v2.3.4.6

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