Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official PayPal IPN Support Thread


Mark Evans

Recommended Posts

Hi Terra, I did not switched on the IPN. I do not have SSL, it's a shared hosting, with PHP 4.3.2.

I added in the mail(....) as mentioned, and still getting nothing. But if i type the full URL of www.xxx.com/ext/modules/payment/paypal_ipn/ipn.php, "mail('[email protected]', 'testing paypal', 'paypal has found the file');" works. Is it my paypal problem?

Your hosting company advised that you can only use Port 443 if you have a full ssl so the problem is probably that PayPal IPN tries to use port 443 (as your PHP version is 4.3.x) and fails.

 

Can you try the following? In your ipn.php at the top find this:

  if ( (PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://' . $server, 443, $errno, $errstr, 30)) ) {
$fsocket = true;
 } elseif (function_exists('curl_exec')) {
$curl = true;
 } elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) {
$fsocket = true;
 }

 

and replace with this:

  if ( (PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://' . $server, 80, $errno, $errstr, 30)) ) {
$fsocket = true;
 } elseif (function_exists('curl_exec')) {
$curl = true;
 } elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) {
$fsocket = true;
 }

 

if that fails, try this (NB: this transmits the data unencrypted unless you have CURL enabled, so don't try this unless you have to):

  if (function_exists('curl_exec')) {
$curl = true;
 } elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) {
$fsocket = true;
 }

 

Can you please report back on this thread whether one of the fixes worked? I'm keen to implement a permanent solution for this problem but first I need to know what kind of server set up triggers it & how it can be solved. Unfortunately on my own servers it works straight out of the box, so I can't replicate the problem.

 

Can you also advise:

1. if CURL is enabled on your server? (you can check under "tools -> server info")

2. If your server has OpenSSL compiled? (again should be mentioned in server info)

3. If OpenSSL is available, whether the pathway is "/usr/bin/openssl"?

 

sorry if that's a lot of questions but if we can get the bottom of this problem, it won't just benefit your site but lots of users as it'll help to update the module.

 

all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Hi Kogyarus,

 

I've found another solution the PayPal forum ... ready to try something out? In your ipn.php find this:

 if ($fsocket == true) {
$header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n" .
		  'Host: ' . $server . "\r\n" .
		  'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
		  'Content-Length: ' . strlen($parameters) . "\r\n" .
		  'Connection: close' . "\r\n\r\n";

 

and replace with this:

 if ($fsocket == true) {
$header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n" .
		  'Host: ' . $server . ":80\r\n" .
		  'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
		  'Content-Length: ' . strlen($parameters) . "\r\n" .
		  'Connection: close' . "\r\n\r\n";

 

If you have time, I'd still appreciate the info requested in my earlier post & feedback ... maybe between us we can finally solve this! Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Integration Guide

PayPal IPN v2.2 with Imprint Text Options v1.3.1

 

In /includes/modules/payment/paypal_ipn.php find around line 216

 $order_products_id = tep_db_insert_id();

 

and immediately below add

// denuz text attr

$attr_q = tep_db_query("select * from customers_basket_text_attributes where session_id = '$_SESSION['osCsid']' and products_id = " . tep_get_prid($order->products[$i]['id']));
while ($attr = tep_db_fetch_array($attr_q)) {
   tep_db_query("insert into orders_text_attributes values ($insert_id, " . tep_get_prid($order->products[$i]['id']) . ", " . $attr['products_text_attributes_id'] . ", '" .  $attr['products_text_attributes_text'] . "')");
}
tep_db_query("delete from customers_basket_text_attributes where products_id = " . tep_get_prid($order->products[$i]['id']) . " and session_id = '" . $_SESSION['osCsid'] . "'");

// eof denuz text attr

 

Pleas note the change from $osCsid to $_SESSION['osCsid']. Not tested but in theory should work :thumbsup:

 

all the best - Terra

 

Hi, Terra:

Thanks for the guidance on this. I've installed everything and it went rather smoothly, save for one minor problem.

 

When I integrated the above code into the paypal_ipn.php file, I got this error:

 

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jewelryb/public_html/catalog/includes/modules/payment/paypal_ipn.php on line 219

 

So I replaced it with the original "Imprint Text Options" code (without the $_SESSION added), and no error was encountered.

 

My question is: Should I leave the code as is? Or do I need to add the $_Session in elsewhere? I haven't enabled the IPN module yet.

 

I should point out that I also had to manually add a very small amount of coding (towards the end of the file) for the "Coupons by Ingo" contribution that I've got installed on my site, but I don't think that has anything to do with this error.

 

Thanks in advance for any help!!

:-)

 

Mary

Link to comment
Share on other sites

Hi Terra, I did not switched on the IPN. I do not have SSL, it's a shared hosting, with PHP 4.3.2.

I added in the mail(....) as mentioned, and still getting nothing. But if i type the full URL of www.xxx.com/ext/modules/payment/paypal_ipn/ipn.php, "mail('[email protected]', 'testing paypal', 'paypal has found the file');" works.

 

Is it my paypal problem?

 

Just a quick question while i am doing the tests mentioned. If i am not getting anything with "mail('[email protected]', 'testing paypal', 'paypal has found the file');" at the top of my ipn.php, why am i looking beyond this point?

 

Assume that paypal has sent out the data, it is obvious that there's something not right that the data is not reaching my ipn.php. Correct me if i am wrong.

Link to comment
Share on other sites

Just a quick question while i am doing the tests mentioned. If i am not getting anything with "mail('[email protected]', 'testing paypal', 'paypal has found the file');" at the top of my ipn.php, why am i looking beyond this point?

Okay - well for starters I don't know at which stage the email was placed in the script. If it's right at the top then you're right - PayPal does not access your file. The ipn update pathway is sent in the paypal_ipn.php:

$parameters['notify_url'] = tep_href_link('ext/modules/payment/paypal_ipn/ipn.php', '', 'SSL', false, false);

and if you look into your /includes/functions/html_output.php you'll see that tep_href_link calls in the info as entered in the configure file:

	if ($connection == 'NONSSL') {
  $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
} elseif ($connection == 'SSL') {
  if (ENABLE_SSL == true) {
	$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
  } else {
	$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
  }
} else {

so unless you have a problem with your folder structure or you set up the configure file wrongly, I don't know what can be going wrong - it really *should* work. Terra :'(

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jewelryb/public_html/catalog/includes/modules/payment/paypal_ipn.php on line 219

Hi Mary - please try this. I originally copied the code from the contrib but looking at it in detail it doesn't look right. I've now re-written it and it *should* work now, hopefully! That'll teach me to user other people's code without double-checking :blush:

 

Integration Guide

PayPal IPN v2.2 with Imprint Text Options v1.3.1

REVISED

 

In /includes/modules/payment/paypal_ipn.php find around line 216

 $order_products_id = tep_db_insert_id();

 

and immediately below add

// denuz text attr

$attr_q = tep_db_query("select * from customers_basket_text_attributes where session_id = '" . $_SESSION['osCsid'] . "' and products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
while ($attr = tep_db_fetch_array($attr_q)) {
   tep_db_query("insert into orders_text_attributes values ($insert_id, " . tep_get_prid($order->products[$i]['id']) . ", " . $attr['products_text_attributes_id'] . ", '" .  $attr['products_text_attributes_text'] . "')");
}
tep_db_query("delete from customers_basket_text_attributes where products_id = '" . tep_get_prid($order->products[$i]['id']) . "' and session_id = '" . $_SESSION['osCsid'] . "'");

// eof denuz text attr

 

Pleas note the change from $osCsid to $_SESSION[osCsid]. Not tested but in theory should work :thumbsup:

 

all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Aaron - I have no idea what you did or tried to install .. the PayPal IPN module does not require any file changes, just uploading 3 new files (paypal_ipn.php and ipn.php). Sorry - Terra

 

I was trying to add the discount coupon contribution designed for the IPN. I've come up with a work around, but its kind of strange. I can't find the FILENAME_(various files), which I assume are in the Database somewhere.

 

I'm going to tear it down and re-install from the beginning.

 

I'll put up a guide to the Easy Populate, Paypal WPP, Paypal IPN and then (hopefully) Discount Coupons.

 

-Aaron

TummyToys.com

Link to comment
Share on other sites

Hi Mary - please try this. I originally copied the code from the contrib but looking at it in detail it doesn't look right. I've now re-written it and it *should* work now, hopefully! That'll teach me to user other people's code without double-checking :blush:

 

Integration Guide

PayPal IPN v2.2 with Imprint Text Options v1.3.1

REVISED

 

In /includes/modules/payment/paypal_ipn.php find around line 216

 $order_products_id = tep_db_insert_id();

 

and immediately below add

// denuz text attr

$attr_q = tep_db_query("select * from customers_basket_text_attributes where session_id = '" . $_SESSION['osCsid'] . "' and products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
while ($attr = tep_db_fetch_array($attr_q)) {
   tep_db_query("insert into orders_text_attributes values ($insert_id, " . tep_get_prid($order->products[$i]['id']) . ", " . $attr['products_text_attributes_id'] . ", '" .  $attr['products_text_attributes_text'] . "')");
}
tep_db_query("delete from customers_basket_text_attributes where products_id = '" . tep_get_prid($order->products[$i]['id']) . "' and session_id = '" . $_SESSION['osCsid'] . "'");

// eof denuz text attr

 

Pleas note the change from $osCsid to $_SESSION[osCsid]. Not tested but in theory should work :thumbsup:

 

all the best - Terra

 

 

Worked like a charm! No more error. Yippee!!

I couldn't be happier :D

 

Also, I enabled, configured & tested the Paypal IPN and all seems well.

My next step will be to test a new product that has a text attribute option combined with using a coupon during checkout....just to make sure everything is still okay with those.

But as far as this contribution is concerned---wow! Great instructions, easy-to-install, and works wonderfully!

 

Thanks again~your help was greatly appreciated.

 

Mary

Link to comment
Share on other sites

Hi,

Great contribution, it all works well for me but there are 2 problems i want to solve.

I have installed the v2.2 and test run in paypal sandbox.

 

1. When coming in to the first page in paypal i got a error text:

 

You have entered unsupported characters for this field. Current available language character types are: European, Chinese, Korean, Japanese, and Thai. Please try again.

See link: paypal page1

 

2. after customer log in and at the next page the Sale tax is shown with 0. How to get ride of this.

 

See link: paypal page2

 

 

XX my module set up is like this:

 

PayPal IPN

 

Enable PayPal IPN Module

True

 

Gateway Server

Testing

 

E-Mail Address

[email protected]

 

Sort order of display.

3

 

Transaction Currency

Selected Currency

 

Payment Zone

--ingen--

 

Force shipping address?

False

 

Set Preparing Order Status

Preparing [PayPal IPN]

 

Set PayPal Acknowledged Order Status

Preparing [PayPal IPN]

 

Set PayPal Completed Order Status

Mottagen

 

Transaction Type

Aggregate

 

Move tax to total amount

True

 

Page Style

 

 

Debug E-Mail Address

[email protected]

 

Enable Encrypted Web Payments

False

 

Your Private Key

 

 

Your Public Certificate

 

 

PayPals Public Certificate

 

 

Your PayPal Public Certificate ID

 

 

Working Directory

 

 

OpenSSL Location

/usr/bin/openssl

 

 

It would be great with help to solve this

Thanks/ Charlie

Link to comment
Share on other sites

Hi,

Great contribution, it all works well for me but there are 2 problems i want to solve.

I have installed the v2.2 and test run in paypal sandbox.

 

1. When coming in to the first page in paypal i got a error text:

 

You have entered unsupported characters for this field. Current available language character types are: European, Chinese, Korean, Japanese, and Thai. Please try again.

See link: paypal page1

 

2. after customer log in and at the next page the Sale tax is shown with 0. How to get ride of this.

 

See link: paypal page2

XX my module set up is like this:

 

PayPal IPN

 

Enable PayPal IPN Module

True

 

Gateway Server

Testing

 

E-Mail Address

[email protected]

 

Sort order of display.

3

 

Transaction Currency

Selected Currency

 

Payment Zone

--ingen--

 

Force shipping address?

False

 

Set Preparing Order Status

Preparing [PayPal IPN]

 

Set PayPal Acknowledged Order Status

Preparing [PayPal IPN]

 

Set PayPal Completed Order Status

Mottagen

 

Transaction Type

Aggregate

 

Move tax to total amount

True

 

Page Style

Debug E-Mail Address

[email protected]

 

Enable Encrypted Web Payments

False

 

Your Private Key

Your Public Certificate

PayPals Public Certificate

Your PayPal Public Certificate ID

Working Directory

OpenSSL Location

/usr/bin/openssl

It would be great with help to solve this

Thanks/ Charlie

 

Terra,

 

Whats the recommended PayPal IPN version or module to run ? I currently have PayPal IPN Payment Module v1.3 which does seem to have some bugs. It would be great if someone could recommend a better version which is more efficient.

Link to comment
Share on other sites

Terra, Whats the recommended PayPal IPN version or module to run ? I currently have PayPal IPN Payment Module v1.3 which does seem to have some bugs. It would be great if someone could recommend a better version which is more efficient.

Amit - if your shop relies on integrating the PayPal IPN with other contributions (CCGV, QTPro etc.) then versions 1.x are currently the only option as versions 2.x don't yet have the integration guides available. Version 1.4 is the last one which has the integration guides for CCGV(trad), QTPro and osCAffiliate.

 

But if your shop doesn't use other contributions which affect checkout then version 2.3 is recommended. Having said that I've got version 2.4 under way, so you may want to wait a few weeks before changing your site.

 

All updates to the PayPal IPN are published here: http://www.oscommerce.com/community/contributions,2679

 

Main difference of version 2.x vs 1.x: Versions 2.x don't rely on the customer returning from PayPal - order emails, stock updates etc. are all handled by the IPN. Downside is that integrating the IPN with other contributions is now more difficult than it was before.

 

all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

1. When coming in to the first page in paypal i got a error text:

 

You have entered unsupported characters for this field. Current available language character types are: European, Chinese, Korean, Japanese, and Thai. Please try again.

See link: paypal page1

 

2. after customer log in and at the next page the Sale tax is shown with 0. How to get ride of this.

See link: paypal page2

Hi Charlie,

 

TAX

Move tax to total - set to FALSE (but please note that in some scenarios this has been known to cause problems)

CHARACTERS

There was a debate on this thread a few pages further back about unsupported characters. Please review this thread and see if it's any help. The character encoding of your site would depend on the character encoding of the pages & your database. If the information published on this thread doesn't help, please post back with full information about your character encoding set-up (pages / database) and what you already tried to solve this problem. If you do a search on this thread about "character" or "encoding" you will find the relevant posts quickly.

 

all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Amit - if your shop relies on integrating the PayPal IPN with other contributions (CCGV, QTPro etc.) then versions 1.x are currently the only option as versions 2.x don't yet have the integration guides available. Version 1.4 is the last one which has the integration guides for CCGV(trad), QTPro and osCAffiliate.

 

But if your shop doesn't use other contributions which affect checkout then version 2.3 is recommended. Having said that I've got version 2.4 under way, so you may want to wait a few weeks before changing your site.

 

All updates to the PayPal IPN are published here: http://www.oscommerce.com/community/contributions,2679

 

Main difference of version 2.x vs 1.x: Versions 2.x don't rely on the customer returning from PayPal - order emails, stock updates etc. are all handled by the IPN. Downside is that integrating the IPN with other contributions is now more difficult than it was before.

 

all the best - Terra

 

Terra,

 

I have a wierd problem. My shipping rates are not transferred correctly for some of the items. i.e. the shipping rate calculated by USPS or UPS and displayed in the oscommerce cart is not the same amount transferred to paypal.

 

Again this is not true for all orders. If you get the time try it on my site,

 

www.underthesunstore.com and try buying two of one kind of handmade printable paper and 1 another kind of handmade printable paper. Choose priority mail in USPS or ground in UPS see the amount of shipping displayed and see the amount of shipping transferred to paypal.

 

The amounts are different . PayPal shows a much higher amount transferred for shipping because of which people are almost completing their orders but going away since there is mismatch of shipping between our website and paypal.

 

Remember it does not occur for all orders so try what I described above and you will see what I am talking about.

 

Thanks in advance , hope you can check it out.

 

Amit

Link to comment
Share on other sites

Hello,

I've recently changed the PayPal default module to the Paypal IPN and my users are experiencing a PayPal timeout, not being able to complete the transaction; I tested the module with the sandbox without problems! What can I do? Did anybody have the same problem?

 

Thanks,

namex

Link to comment
Share on other sites

I have a wierd problem. My shipping rates are not transferred correctly for some of the items. i.e. the shipping rate calculated by USPS or UPS and displayed in the oscommerce cart is not the same amount transferred to paypal.

Amit - have you turned on shipping in your PayPal account? If there's a shipping calculation in your PayPal account it overrides your shop's shipping. Either way, my recommend setting for the IPN is "AGGREGATE" - with aggregate only one lump sum is transferred to PayPal. all the best - Terra

PS: please delete my test order from your shop and I'd recommend to rethink your sign up procedure - most customers are not happy when having to enter their date of birth and gender just to buy some paper.

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Amit - have you turned on shipping in your PayPal account? If there's a shipping calculation in your PayPal account it overrides your shop's shipping. Either way, my recommend setting for the IPN is "AGGREGATE" - with aggregate only one lump sum is transferred to PayPal. all the best - Terra

PS: please delete my test order from your shop and I'd recommend to rethink your sign up procedure - most customers are not happy when having to enter their date of birth and gender just to buy some paper.

Hi Terra,

 

Thanks for the suggestions. I have overide profile settings and allow transaction based checked so it should override any profile based shipping.

 

It still seems to calculate the shipping wierdly. The shipping is correct if you order only one quantity and or multiple of the same item generally or atleast thats what I have observed till now.

 

Any further inputs ? Is there a way i can catch the shipping value being transferred to paypal and see where the problem may be occuring ?

Link to comment
Share on other sites

Any further inputs ? Is there a way i can catch the shipping value being transferred to paypal and see where the problem may be occuring ?

You can email yourself the values - in your ipn.php towards the top add the following code just above

email('[email protected]', 'order variables', print_r($_POST, true));

.. hope that's the correct way of doing this, it's from memory .. that should send an email to the specified email address with the variables sent over to PayPal.

 

If your shop is set to per item, then shipping is calculated as follows in paypal_ipn.php

			if (DISPLAY_PRICE_WITH_TAX == 'true') {
		  $shipping_cost = $order->info['shipping_cost'];
		} else {
		  $module = substr($shipping['id'], 0, strpos($shipping['id'], '_'));
		  $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
		  $shipping_cost = $order->info['shipping_cost'] + tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);
		}

		$parameters['shipping_' . $item] = number_format($shipping_cost * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

You can email yourself the values - in your ipn.php towards the top add the following code just above

email('[email protected]', 'order variables', print_r($_POST, true));

.. hope that's the correct way of doing this, it's from memory .. that should send an email to the specified email address with the variables sent over to PayPal.

 

If your shop is set to per item, then shipping is calculated as follows in paypal_ipn.php

			if (DISPLAY_PRICE_WITH_TAX == 'true') {
		  $shipping_cost = $order->info['shipping_cost'];
		} else {
		  $module = substr($shipping['id'], 0, strpos($shipping['id'], '_'));
		  $shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
		  $shipping_cost = $order->info['shipping_cost'] + tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);
		}

		$parameters['shipping_' . $item] = number_format($shipping_cost * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));

Terra

 

 

Terra,

 

What code is to be added and where ? I am little confused as I could not find

 

email('[email protected]', 'order variables', print_r($_POST, true));

 

or is that what I need to add, if yes, where ?

 

Thanks

 

Amit

Link to comment
Share on other sites

What code is to be added and where ? I am little confused as I could not find

Amit - small typo, I meant for the email code to be added to the top of the ipn.php file but like I said the code is from memory so no guarantees - I'm afraid I'm a hands-on-coder and my memory is cra**. Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Amit - small typo, I meant for the email code to be added to the top of the ipn.php file but like I said the code is from memory so no guarantees - I'm afraid I'm a hands-on-coder and my memory is cra**. Terra

 

Terra,

 

The problems seems to have been solved by switching to "aggregate total" transfer to paypal. But do we know why this error occurs and why is it recommendable to transfer "aggregate total" instead of "per item" transaction to paypal. The reason I ask is if I am the cutomer I would really like to look at what I am paying for instead of just a total displayed to paypal when I make my final payment, its a good sense of comfort.

 

Is there a way to display the items in the shopping cart without going to the " per item" format. If not, are we trying to solve this bug in the next releases of the paypal IPN.

 

Thanks for your input as always.

 

Amit

Link to comment
Share on other sites

I am having troubles. The amount of money to pay is not transferring to Paypal. And the currency in Paypal is USD, I want it to be NZD. Do I need to open a merchant account?

No - you don't need a merchant account. Make sure that your shop's currency code is "NZD" (under localisation -> currency) and that your PayPal business account is correctly set up in NZD. When you set up the paypal payment module you will see that you can either set it to only one selected currency (inc NZD) or whichever currency the customer chooses on your site (if your shop is multi-currency).

 

USD is the default, so if it defaults to USD it either means that the currency is not correctly picked up by PayPal - the most likely problem is that a wrong code is being used, or that a non-supported currency defaults to USD.

 

If the above doesn't sort your problem, please post back with details of your shop's currency setting & let us know which currencies your shop is using. A link to your shop would also be great.

 

all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Your hosting company advised that you can only use Port 443 if you have a full ssl so the problem is probably that PayPal IPN tries to use port 443 (as your PHP version is 4.3.x) and fails.

 

Can you try the following? In your ipn.php at the top find this:

  if ( (PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://' . $server, 443, $errno, $errstr, 30)) ) {
$fsocket = true;
 } elseif (function_exists('curl_exec')) {
$curl = true;
 } elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) {
$fsocket = true;
 }

 

and replace with this:

  if ( (PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://' . $server, 80, $errno, $errstr, 30)) ) {
$fsocket = true;
 } elseif (function_exists('curl_exec')) {
$curl = true;
 } elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) {
$fsocket = true;
 }

 

if that fails, try this (NB: this transmits the data unencrypted unless you have CURL enabled, so don't try this unless you have to):

  if (function_exists('curl_exec')) {
$curl = true;
 } elseif ($fp = @fsockopen($server, 80, $errno, $errstr, 30)) {
$fsocket = true;
 }

 

Can you please report back on this thread whether one of the fixes worked? I'm keen to implement a permanent solution for this problem but first I need to know what kind of server set up triggers it & how it can be solved. Unfortunately on my own servers it works straight out of the box, so I can't replicate the problem.

 

Can you also advise:

1. if CURL is enabled on your server? (you can check under "tools -> server info")

2. If your server has OpenSSL compiled? (again should be mentioned in server info)

3. If OpenSSL is available, whether the pathway is "/usr/bin/openssl"?

 

sorry if that's a lot of questions but if we can get the bottom of this problem, it won't just benefit your site but lots of users as it'll help to update the module.

 

all the best - Terra

 

 

 

Hi Terra,

 

I've been having the same trouble and unfortunately neither of the above fixes worked. To answer your questions above:

 

1. CURL is enabled: libcurl/7.10.3 OpenSSL/0.9.7b zlib/1.1.4

 

2. OpenSSL is compiled: OpenSSL 0.9.7b 10 Apr 2003

 

3. The pathway shown in the IPN settings is /usr/bin/openssl ... there's a section in Configure command at the top of server info that says "--with-openssl=/usr' " if that helps.

 

I hope some of this helps - thanks for all your efforts on behalf of those of us who don't understand it!

 

 

 

Adam

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