Jump to content
Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

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

You can define what character encoding you use in your PayPal account under Profile.

 

For more information I strongly recommend reading the Website Payments Standard Integration Guide, Chapter "Language Encoding your Language" (page 50). To download the PDF go here: https://www.paypal.com/IntegrationCenter/ic...umentation.html (second link from the top).

 

You can also send it as variable. You'd need to add the variable to paypal_ipn.php around line 410 and set it to your correct language encoding:

$parameters['charset'] = 'utf8'; // change to correct encoding!

A list of supported encodings is in the PDF guide on page 111. You should know what your encoding is by looking at the encoding in the header of your web pages and your MySQL settings.

 

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

Share this post


Link to post
Share on other sites
With this fix, you will always get pre-populated forms, and not showing any shipping address info at PayPal pages.

Alex - I think we just got crossed wires. Showing the shipping address on the PayPal page was a request made on this thread as otherwise the order is not eligibile for PayPal's seller protection. Only orders which show a shipping address on the PayPal invoice are eligible. Setting the shipping therefore to "2" was a request made on this thread which I supported by adding the "force shipping" functionality.

 

Please see these posts for background:

http://forums.oscommerce.com/index.php?sho...mp;#entry988159 (post 1721 on page 87)

http://forums.oscommerce.com/index.php?sho...mp;#entry900227 (post 1204 on page 61)

http://forums.oscommerce.com/index.php?s=&...st&p=900175 (post 1201 on page 61)

 

Anybody who doesn't want force shipping, can simply leave it as "false".

 

I'm not ignoring your code because of your English or anything else. I just think we have crossed wires with regards to PayPal's Seller Protection. With your code, the orders are all ineligible for seller protection which defeats the purpose of "force shipping".

 

I have added screenshots to the contribution to show how the Seller Protection works.

 

For more information on PayPal's Seller Protection please go here:

https://www.paypal.com/cgi-bin/webscr?cmd=_...wer_id=16777219

 

In summary - the "force shipping" forces a customer to supply their verified PayPal address to the shop. The orer is eligible for Seller Protection if the osCom delivery address matches the PayPal delivery address.

 

Any shop which does not want or need forced shipping (e.g. for downloads) can simply leave the setting as "false" in the module. But shops who rely on PayPal's Seller Protection can now force it by setting it to "true".

 

all the best - Terra

Edited by 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 **

Share this post


Link to post
Share on other sites
Thanks for your help AlexStudio and Terra. I made changes accordingly and everything with my site is working perfectly. Terra does your Version 2.2 Relase contain the AlexStudio fix

Please see my post above - it's not a bug, it's how the code is supposed to work. If you don't want forced shipping, just leave it as "false" in your module. 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 **

Share this post


Link to post
Share on other sites
Regarding the country problem - I had this issue on one site and it was linked to the latest code release in osCommerce: http://www.oscommerce.com/ext/update-20060817.html

Reversing the change in /includes/functions/general.php got rid of the issue, although I haven't looked into the implications of whether this poses a problem elsewhere.

all the best - Terra

 

Thanks Terra for the info but, everyone using the latest time-stamp release of osC like I'm doing will have this issue when using the 2.2 IPN.

I will have a look into this problem en see if I can find something about known problems or anything related to changing the code back in the general.php.

 

At the moment I'm using the 1.2 release of the IPN module and this module has no problems with my latest time-stamp release osC shop.

Maybe this will ring a bell and helps in solving this.

 

All the best!


Norman in 't Veldt

 

Moderator

osCommerce The Netherlands

Share this post


Link to post
Share on other sites
Thanks Terra for the info but, everyone using the latest time-stamp release of osC like I'm doing will have this issue when using the 2.2 IPN.

I will have a look into this problem en see if I can find something about known problems or anything related to changing the code back in the general.php.

 

At the moment I'm using the 1.2 release of the IPN module and this module has no problems with my latest time-stamp release osC shop.

Maybe this will ring a bell and helps in solving this.

The error is in osComerce and applies to ANY payment module, regardless of whether it's PayPal IPN or e.g. Cash on Delivery. Whilst it works in emails for most payment modules, the bug can be seen by logging into account -> view my past orders ... that page displays the same truncated country problem regardless of what payment modules was used (tested in my case with IPN & cash on delivery). The only difference with the IPN is that it also shows in the email due to the difference in how the email is constructed.

 

The error is introduced in /includes/functions/general.php on line 453. The latest osCom release has:

$country = tep_output_string_protected($address['country']['title']);

but it should be:

$country = tep_output_string_protected($address['country']);

 

Please note that this is not a bug in the IPN - it applies to any payment module and is related to this alteration in the function tep_address_format() and is most visible in "my account -> order history".

 

Background for developers:

The problem occurs because of the 2 different ways of how $order is constructed in the order class. The way $order is constructed during checkout differs from how it's constructed once an order id has been assigned. The relevance to the above problem is that during checkout $order['country'] is an array, but after an id has been assigned, it's not. Hence the variable $address['country']['title'] doesn't exist on the my account page, not does it exist when the email is compiled in the ipn.php.

 

Snippet from order class:

if (tep_not_null($order_id)) {
	$this->query($order_id);
  } else {
	$this->cart();

.....

function query($order_id) {
  global $languages_id;
.....
'country' => $order['delivery_country'],
.........
}

function cart() {
  global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment;
........
'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),
......
}

all the best - Terra

Edited by 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 **

Share this post


Link to post
Share on other sites
You can define what character encoding you use in your PayPal account under Profile.

 

For more information I strongly recommend reading the Website Payments Standard Integration Guide, Chapter "Language Encoding your Language" (page 50). To download the PDF go here: https://www.paypal.com/IntegrationCenter/ic...umentation.html (second link from the top).

 

You can also send it as variable. You'd need to add the variable to paypal_ipn.php around line 410 and set it to your correct language encoding:

$parameters['charset'] = 'utf8'; // change to correct encoding!

A list of supported encodings is in the PDF guide on page 111. You should know what your encoding is by looking at the encoding in the header of your web pages and your MySQL settings.

 

all the best - Terra

 

 

Special character???

 

I've tried basically ALL possibilities...

 

My headings says define('CHARSET', 'iso-8859-1'); -

so I tried to set Paypal like ISO-8859-1 *nope didn't work

 

Tried 1252, which work in all my ASP sites *nope didn't work

Tried ISO-8859-13 / ISO-8859-15, which work in some of my ASP sites *nope didn't work

 

also tried this in the paypal_ipn.php file *nope didn't work

$parameters['charset'] = '<?php echo CHARSET; ?>'; // change to correct encoding!

tried many other number combinations in the paypal_ipn.php file *nothing worked

 

Am I the only one comming from an european country?????

heeeeeeeellllp ( I did try to figure it out reading the Paypal PDF file - no clear guidance )

 

Helle :(

Share this post


Link to post
Share on other sites

Just to recap - this is how /includes/functions/general.php around line 446 should look like:

 

	if (isset($address['country_id']) && tep_not_null($address['country_id'])) {  
  $country = tep_get_country_name($address['country_id']);

  if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {
	$state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);
  }
} elseif (isset($address['country']) && tep_not_null($address['country'])) {
  $country = tep_output_string_protected($address['country']); // NOTE THE DIFFERENCE ON THIS LINE!
} else {
  $country = '';
}

 

This is the correct code & rectifies the error in the latest osCom release. :thumbsup:

 

The first 2 if statements apply if the $order['country'] is an array, e.g. during checkout. The elseif statement applies if it's not an array, e.g. on my account -> view orders or when constructing the ipn email.

 

Please note that these changes do not impact anything on the admin side (invoice slips) etc. as the admin has it's own general.php file which is error-free. To check, just have a look at admin/includes/functions/general.php around line 364 ... the code will look exactly like the code above, another proof that the change in the latest osCom release is a bug. And we all know what to do with bugs :D

 

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

Share this post


Link to post
Share on other sites

Hello,

 

I have a small problem with this wonderful contributions. I hope somebody can help.

 

I am using the contribution Quantity for Products Attributes, which is, I believe, a simpler version of QTpro. All it does is add a column "options_quantity" to the table TABLE_PRODUCTS_ATTRIBUTES. When an order is placed, this quantity is updated.

 

I am trying to add this quantity update to ipn.php. I took part of the code that this contribution added to checkout_process, and added the following code to ipn.php. I don't know what's wrong (maybe I put it at the wrong place), but it doesn't work. The whole IPN process still goes well, but the options_quantity is not updated.

 

here is the code I added:

	$products_ordered_attributes = '';
  if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
		for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {

			 if (DOWNLOAD_ENABLED == 'true') {

	  $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.options_quantity, pa.products_attributes_id, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
						   from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
						   left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
							on pa.products_attributes_id=pad.products_attributes_id
						   where pa.products_id = '" . $order->products[$i]['id'] . "' 
							and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
							and pa.options_id = popt.products_options_id 
							and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
							and pa.options_values_id = poval.products_options_values_id 
							and popt.language_id = '" . $languages_id . "' 
							and poval.language_id = '" . $languages_id . "'";

	  $attributes = tep_db_query($attributes_query);

	} else {
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.options_quantity, pa.products_attributes_id from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
	}

	$attributes_values = tep_db_fetch_array($attributes);


	$new_quantity = $attributes_values['options_quantity'] - $order->products[$i]['qty']; 
	tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_quantity = '" . $new_quantity . "' where products_attributes_id = '" . $attributes_values['products_attributes_id'] . "'");


}
 }

 

I would be very grateful when somebody could just explain to me how to get the options_quantity in this table updated in the ipn.php file. Thank you very much!

Share this post


Link to post
Share on other sites

I'm normally pretty good at these, but I'm just getting started with OSCommerce. I'm trying to add the PayPal IPN module. As I understand the instructions, I simply need to copy the files from Terra's most recent update into the correct directories (relative to where ./catalog is stored). For example:

 

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

is copied into

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

(in this case, creating the ./ext tree)

 

and so on for each of the files in the catalog section of the zip file. Things in the screenshots and help section are for my own information.

 

I did these additions, but when I go into the admin page to install the new payment module, the PayPal IPN module is not show (even after a reload of the page). Obviously I'm missing something simple because I see lots of "the install was easy, but now I've got questions...). HELP :)

Share this post


Link to post
Share on other sites
I did these additions, but when I go into the admin page to install the new payment module, the PayPal IPN module is not show (even after a reload of the page). Obviously I'm missing something simple because I see lots of "the install was easy, but now I've got questions...). HELP :)

Most likely an error with a paypal_ipn.php file - make sure that all files are in the correct location and that you didn't mix up the language level file with the root file by mistake. They have the same file name but are in different folders. 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 **

Share this post


Link to post
Share on other sites
Most likely an error with a paypal_ipn.php file - make sure that all files are in the correct location and that you didn't mix up the language level file with the root file by mistake. They have the same file name but are in different folders. all the best - Terra

Hmm. I just tried this again. I added (well, replaced at this point) all 5 files being careful to make sure each is in the proper place. I then went to the Admin panel, Modules, Payment and while PayPal is listed (among others), there is no PayPal IPN module. Is there something that needs to be regenerated to let OSC know that there is a new module addition? :'( The only other thing is I set the permissions the same as the other modules (644 rather than the default 755).

 

On a (semi) related note: Is there anywhere GOOD to read about the various payment vendors? When we first started thinking about this, we were thinking about using Costco since their rates are so much lower (1.99%), but for now PayPal seems the easiest to get started with and isn't horrible about the rates. 2Checkout seemed very high in comparison (unless I'm missing something). A pointer to a relavent discussion thread would be greatly appreciated.

Edited by gof

Share this post


Link to post
Share on other sites
... there is no PayPal IPN module.

It's called "Credit/Debit Card (via PayPal)". Terra

PS: please start a new thread for queries unrelated to the IPN module. This thread has 99 pages - we really don't need any more content. ;)


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

Share this post


Link to post
Share on other sites
It's called "Credit/Debit Card (via PayPal)". Terra

D'oh! :blush: There it is. I could have swore it said "PayPal IPN" somewhere in the docs...

 

PS: please start a new thread for queries unrelated to the IPN module. This thread has 99 pages - we really don't need any more content. ;)

 

I'll do that. I was figuring there was already another 99 page thread discussing it that I missed :)

 

Thanks again!

Share this post


Link to post
Share on other sites

Well like all the other newbies ( I am guessing anyway) I found out the hard way about the not returning to the site after paypal payment problem and my first order was not saved. HMMMM. I have since rectified that with the installation of this great contribution. I do however seem to have a couple of problems. I have gone over and over the documentation but to no avail. I am hoping for a little help here.

 

I have a very limited amount of a certain product and need the stock levels to change almost immediately. I do not want to set the order completed until I ship it but would like the stock levels adjusted as soon as I recieve the payment. It is my understanding that it is supposed to work this way and I am not sure why it is not for me

 

Currently the status never changes from preparing ipn. I have manually set the process to pending after verifiying that a payment has been made.

 

I am using osCommerce_PayPal_IPN_v1.5 and paypal is the only payment I accept. Any help is much appreciated.

 

Diane

Share this post


Link to post
Share on other sites
Alex - I think we just got crossed wires. Showing the shipping address on the PayPal page was a request made on this thread as otherwise the order is not eligibile for PayPal's seller protection. Only orders which show a shipping address on the PayPal invoice are eligible. Setting the shipping therefore to "2" was a request made on this thread which I supported by adding the "force shipping" functionality.

 

Anybody who doesn't want force shipping, can simply leave it as "false".

 

I'm not ignoring your code because of your English or anything else. I just think we have crossed wires with regards to PayPal's Seller Protection. With your code, the orders are all ineligible for seller protection which defeats the purpose of "force shipping".

 

I have added screenshots to the contribution to show how the Seller Protection works.

 

In summary - the "force shipping" forces a customer to supply their verified PayPal address to the shop. The orer is eligible for Seller Protection if the osCom delivery address matches the PayPal delivery address.

 

Any shop which does not want or need forced shipping (e.g. for downloads) can simply leave the setting as "false" in the module. But shops who rely on PayPal's Seller Protection can now force it by setting it to "true".

 

all the best - Terra

Thanks Terra,

 

I read through the PayPal's Seller Protection Pocily before I started to code the EC IPN module, and I'm very clear what it requires for a payment to be eligible. The new EC IPN module fully support this feature without any problem.

 

I tried to fix the form pre-populating issue and found that this official PayPal IPN module barely has any chance to be eligible for seller protection. Please see below:

 

1. Will you give up a payment only because the shipping address is unconfirmed? AFAIK only the credit card billing address in US can be confirmed. Maybe UK will be included soon or already included, but that is still not enough. What if the payer wants to ship to a different address? (e.g. for a gift, or ship to his office, his mother in law...etc) Will you give up the payment because the address is unconfirmed?

 

2. If the answer to above question is YES, than you are in deep trouble. In the new EC IPN module, payers can select a different address from paypal file, which is possibly a confirmed address, and PayPal sends back that address to store, so the EC IPN module can alter the shipping address right away and show it to the customer before pay. If the payer didn't change the address, then PayPal sends back the address which was sent with the order detail in the first place, so EC IPN module go with the address unchanged. This is what it requires to be eligible for seller protection.

 

This CANNOT be achieved in the official IPN module, because there is some problem with PayPal itself. I tried to update the address with IPN response, but it didn't work! You probably think that the address in IPN response supposed to be the payer's PayPal address which could be confirmed, but it is not! PayPal NEVER gives out payer's address unless payers chose to. The address in IPN response should be the one you sent, but it is not either! It is the one shown in the shipping address section at PayPal. I tested to delete a credit card and the address along with it, but PayPal still showed it in the shipping address after deleted, and IPN send back that non-existing address.

 

If the payer selected a different address from file at PayPal, or added a new address, IPN will send back that new address, no matter if it is confirmed or not (most not likely). So the second half of the shipping address mechanism works, but the code in ipn.php can never update the shipping address with the one IPN sent back. You just can't tell if the address in IPN response is the one came from no where or the one altered by the customer.

 

I just don't see any chance to be eligible for seller protection in this, no matter if you 'force shipping address' or not! You NEVER showed the right shipping address to customers at PayPal, so you got no chance to be eligible for seller protection. The only chance is that the payer selected a confirmed address at first in your store, which accidentally got shown at PayPal.

 

3. The reason why I set 'no_shipping' = 1 in my fix is that the address sent to paypal never got shown in the shipping address section. The customer saw that wrong shipping address, and changed that wrong shipping address with a different one. The chances are that the last address settled by the customer is not the one with the order in store, you will never know. Do you see the problem here?

 

There for the only possible workaround is not to show any address to customers at paypal. I hope this is clear enough because I already spent too much time in this.


Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites

Hello,

 

I hope I dont sound to much like an idiot for asking this but I am not sure if this is what I need. I looked at what I am currently using which is btw working great for me with no problems.

 

I am using PayPal IPN v0.981 for Milestone 2 by Pablo Pasqualino. My question is that is this the one I need to install to upgrade what I am currently using or do I need something else.

 

Thanks

Share this post


Link to post
Share on other sites

I'm still fighting with the issue of danish characters? æøå

For the life of .... cannot make it work -

 

Post #1951

 

Also: would it be possible to make the checkout look like this (really nice)

 

screenshot.gif

 

Helle - from the little country that absolutely LOVES strange characters :blush:

Share this post


Link to post
Share on other sites
I hope this is clear enough because I already spent too much time in this.

 

Agreed! You are spending way too much time confusing people in this thread. Why not stick to your own thread for your own contribution?

 

Vger

Share this post


Link to post
Share on other sites

The problem with 'foreign' (non-english) characters is not easy to resolve, and is database related.

 

If your Default Character Set for MySQL, PHP, and phpMyAdmin is Latin1 or iso-8859-1-en (they are the same) then you should not have a problem with Danish characters. This character set handles all Western European language characters okay.

 

The problem occurs if the Default Character set for MySQL and phpMyAdmin is utf-8 while the Default Character set for PHP (in php.ini) is en-iso-8859-1-en or Latin1 and the osCommerce Default Character Set is en-iso-8859-1 or Latin1.

 

If your hosting company is going to use utf-8 then they need to do it for everything - PHP, MySQL, phpMyAdmin, and you need to do it for the default character set for osCommerce and the installation database.

 

If you cannot do that then running the default osCommerce database in via phpMyAdmin and changing the upload default character set to Latin1 should start you off alright. After the initial database installation is done you should not have any further problems with Danish characters.

 

This problem is not related to this thread, so you should start your own thread in Installation and Configuration if this advice does not resolve your problem.

 

Vger

I'm still fighting with the issue of danish characters? æøå

For the life of .... cannot make it work -

 

Post #1951

 

Also: would it be possible to make the checkout look like this (really nice)

 

screenshot.gif

 

Helle - from the little country that absolutely LOVES strange characters :blush:

Share this post


Link to post
Share on other sites

Hi Vger

 

I had no idea of this - but now I do. Thanks for the very well explained information.

When a - to me - unknown problem occure - I ask people whom I believe knows about the problem, the same people who created this great contrib - I don't ask to be rude

 

Helle

Share this post


Link to post
Share on other sites
I am using PayPal IPN v0.981 for Milestone 2 by Pablo Pasqualino. My question is that is this the one I need to install to upgrade what I am currently using or do I need something else.

Lexi - this is a totally different contribution you are using. Please use their support thread or start a new one. This thread is ONLY for the "osCommerce PayPal IPN Module v1.0 For 2.2MS2" contribution, available here: http://www.oscommerce.com/community/contributions,2679 Whether you want to change to this contrib or use your existing one is entirely your choice - I've never installed Pablo's contrib so no idea what's preferable. However - as Pablo's contrib was last updated in July 2004 you may well want to switch to a different module. Really depends if Pablo's is working for you or not (if it ain't broke, no need to fix it). 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 **

Share this post


Link to post
Share on other sites
Currently the status never changes from preparing ipn. I have manually set the process to pending after verifiying that a payment has been made.

Diane - there is a problem in your shop with the ipn.php.

First please make sure that the ipn.php is correctly uploaded into the new /ext/ structure.

Secondly, make sure that the IPN is switched off in your PayPal account.

Thirdly, please confirm if cURL is enabled on your server or not (you can check in your admin under Tools -> Server Info).

And finally, can you get in touch with your hosting provider and check whether there's any firewall etc in place which could stop communication between PayPal and your shop.

 

I'd recommend that you send the following code snippet from the ipn.php file to your hosting provider - they may use a different port number or proxy:

  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;
 }

 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";

@fputs($fp, $header . $parameters);

$string = '';
while (!@feof($fp)) {
  $res = @fgets($fp, 1024);
  $string .= $res;

  if ( ($res == 'VERIFIED') || ($res == 'INVALID') ) {
	$result = $res;

	break;
  }
}

@fclose($fp);
 } elseif ($curl == true) {
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://' . $server . '/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$result = curl_exec($ch);

curl_close($ch);
 }

 

You're not the only one with this issue, so I'm keen to get to the bottom of this. However, it's likely to be server configuration related, so you will need your hosting provider's help to resolve this.

 

If you get it to work, I'd be grateful if you can post your solution on this thread.

 

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

Share this post


Link to post
Share on other sites

Hello,

 

Unless I am wrong, I believe that there is a bug in this otherwise great contribution:

 

the stock update doesn't happen for products with attributes, even for the ones which are not downloads. The quantity in stock stays the same even after the whole IPN process.

 

Is anybody else having this problem?

Share this post


Link to post
Share on other sites
Unless I am wrong, I believe that there is a bug in this otherwise great contribution:the stock update doesn't happen for products with attributes, even for the ones which are not downloads. The quantity in stock stays the same even after the whole IPN process.

I've tested the IPN in the sandbox with a physical product with an attribute and it deducted the stock correctly (stock is deleted once status changes to "PayPal IPN Verified [Completed"). Did your order change this status? Do you have any attribute mods (QTPro etc.)? please provide more info - 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 **

Share this post


Link to post
Share on other sites
I've tested the IPN in the sandbox with a physical product with an attribute and it deducted the stock correctly (stock is deleted once status changes to "PayPal IPN Verified [Completed"). Did your order change this status? Do you have any attribute mods (QTPro etc.)? please provide more info - Terra

 

Have you tried a product with more than one attribute (for example the option "color" and the values "blue" and "red")?

 

My order status was correctly updated. I also try to order product with and without attribute in the same order, and the stock of the ones without attributes was correctly updated.

 

I do use the contribution "quantity for product attribute", but this bug happens with nothing changed at all in the files from your contribution. :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×