Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official PayPal IPN Support Thread


Mark Evans

Recommended Posts

Is it not possible to somehow get graphics into the module like in this other payPal contrib:

 

screenshot.gif

 

I really believe this would be sooooo nice.

I have also, like HSMagic, tried to implement graphics but it didn't look this nice.

Is anybody able to do this??

 

Helle :-)

Link to comment
Share on other sites

I looked in this contrib: PayPal_Shopping_Cart_IPN_v3.1.5

 

And found this in modules/payment/......php:

 

	function javascript_validation() {
  return false;
}


function selection() {
  $img_visa = DIR_WS_MODULES .'payment/paypal/images/visa.gif';
  $img_mc = DIR_WS_MODULES .'payment/paypal/images/mastercard.gif';
  $img_discover = DIR_WS_MODULES .'payment/paypal/images/discover.gif';
  $img_amex = DIR_WS_MODULES .'payment/paypal/images/amex.gif';
  $img_paypal = DIR_WS_MODULES .'payment/paypal/images/paypal_intl.gif';
  $jscript_url = '<a style="cursor: pointer; cursor: hand;"' . " onclick=\"java script:popup=window.open(\'" . $this->cc_explain_url . "\',\'popup\',\'scrollbars,resizable,width=625,height=600,left=50,top=50\'); popup.focus(); return false;\">";
  $cc_explain = '<div style="A.hover{cursor:hand}">' . MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION .' ' .
				"<script>document.writeln('" . $jscript_url .
				MODULE_PAYMENT_PAYPAL_CC_URL_TEXT . "</a>');</script>" .
				'<noscript><a href="' . $this->cc_explain_url . '" target="_blank">' .
				MODULE_PAYMENT_PAYPAL_CC_URL_TEXT . '</noscript>' ."\n".'</div>';
  $paypal_cc_txt = sprintf(MODULE_PAYMENT_PAYPAL_CC_TEXT,
						  tep_image($img_visa,' Visa ','','','align="absmiddle"'),
						  tep_image($img_mc,' MasterCard ','','','align="absmiddle"'),
						  tep_image($img_discover,' Discover ','','','align="absmiddle"'),
						  tep_image($img_amex,' American Express ','','','align="absmiddle"'),
						  tep_image($img_paypal,' PayPal ','','','align="absmiddle"')
						 );
  $fields[] = array('title' => '', //MODULE_PAYMENT_PAYPAL_TEXT_TITLE,
					'field' => '<div><b>' . $paypal_cc_txt . '</b></div>' . $cc_explain );
  return array('id' => $this->code,
			   'module' => $this->title,
			   'fields' => $fields);


 }

function pre_confirmation_check() {
  return false;
}

 

_________________________________________________________

When looking in osCommerce PayPal IPN Module v1.0 For 2.2MS2

modules/payment/paypal_ipn.php i found this:

 
function javascript_validation() {
  return false;
}



  function selection() {
  return array('id' => $this->code,
			   'module' => $this->title);


}

function pre_confirmation_check() {
  return false;
}

 

I tried to replace the code - it looked like "s..." but I'm sure somebody clever could make it work - that way the payment page would be really nice to look at

 

Helle :-)

Maybe a surgetion for a future update

Link to comment
Share on other sites

Hi,

 

For some reason, the country name in the confirmation e-mail is just one character long, for instance:

 

John Doe

1234 Unknown Street

Wentworth Falls, 2782

New South Wales, A

 

Where "A" appears instead of "Australia".

 

Is there a way to fix this bug?

 

Sincerely,

Amar

Link to comment
Share on other sites

The below shows the code to make an older version of IPN work with ccgv(trad). Anyone who knows how to integrate IPN version 2.2 with ccgv(trad)? The code in /includes/modules/payment/paypal_ipn.php has changed quite a lot and some of the code referred to below do no longer exist.

 

Mogens

 

Code for combining PayPal IPN with CCGV(trad)

 

If you have CCGV(trad) and PayPal IPN installed on your site, then you need to manually amend the IPN to make it work. Rule of thumb: whenever modifications to checkout_process.php are made, this need to be reflected in paypal_ipn.php

 

To combine the two contribs, open /includes/modules/payment/paypal_ipn.php.

 

Find this code:

tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();

 

and below add this:

$order_total_modules->update_credit_account($i);// CCGV

 

find this code:

//------insert customer choosen option eof ----
	$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
	$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
	$total_cost += $total_products_price;

	$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
  }

and below add this:

 $order_total_modules->apply_credit();// CCGV

 

find this code:

tep_session_unregister('cart_PayPal_IPN_ID');

 

and below add this:

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');// CCGV
$order_total_modules->clear_posts();// CCGV

 

Tested on live sites and it's all working. Enjoy! Terra

 

Keywords:

PayPal IPN CCGV CCGV(trad) Gift Vouchers & Credit Coupons

Link to comment
Share on other sites

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

Where "A" appears instead of "Australia". Is there a way to fix this bug?

Amar - please see page 98 of this thread (short copy above). It's not a PayPal issue but a general bug in the latest osCom release. There are two posts from myself on page 98 which give the fix. 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

Switch IPN Modules?? - IPN_v3.1.5 vs. Official v2.1

 

 

What is the difference between the "PayPal_Shopping_Cart_IPN_v3.1.5" and the "IPN Module v1.0 For 2.2MS2" modules?

 

- Is one considered superior to the other at this time?

 

I am working on a project that has the IPN_v3.1.5 module installed and I am currently having some issues with it.

 

- Should I consider moving over to the v1.0 For 2.2MS2 version?

 

- Would this be a tricky upgrade?

 

I appreciate any input that you may be able to offer.

 

Thanks.

Link to comment
Share on other sites

PS: I use QTPro myself and with QTPro I had to modify the PayPal IPN manually or it didn't work - I based my earlier reply on the assumption that "quantity for product attribute" works in a similar way to QTPro as both modify the shop to allow attribute stock.

 

 

 

Hi, Terra

I am wondering if the modifications your specified for QTPro+IPN v1.3 intergration are still the same for IPN versions 2.x ?

 

TIA :)

Link to comment
Share on other sites

Hi, Terra, I am wondering if the modifications your specified for QTPro+IPN v1.3 intergration are still the same for IPN versions 2.x ?TIA :)
No sorry - my advice for shops which rely on integrating the IPN module with other contributions is to stay with v1.4 until the integration guides for 2.x are available. Of course, if there's any developer out there with a bit of spare time then a helping hand is much appreciated! 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

No sorry - my advice for shops which rely on integrating the IPN module with other contributions is to stay with v1.4 until the integration guides for 2.x are available. Of course, if there's any developer out there with a bit of spare time then a helping hand is much appreciated! Terra

 

 

 

Terra, you mentioned that you are also using QTPro yourself. Do you have it working for you with IPN v2.x on your site(s) by any chance?

Link to comment
Share on other sites

Hey everybody,

 

I installed the IPN-Modul a view days ago. My Problem: After the payment there is no change in the admin-Area (still Preparing [PayPal IPN] and no customer-validation). I'm not sure but I think there have to be a database-prob (no Paypal-Table is included in my SQL) or the IPN has troube with the register_globals (=on) because of this error message when trying to get to /ext/modules/payment/paypal_ipn/ipn.php file:

 

"Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory."

 

Is this the right method of resolution? Now the Return path is attuned at the Paypal-Admin. So long: Everything is working fine. My argument: It's not really important to get the eMail-validation after the order. One PayPal-Vaildation is enough, isn't it?

 

Thanks for your reply,

Mathias

Link to comment
Share on other sites

Hi,

 

I have just installed the Paypal IPN and all works well, once payment is taken the user is taken back to the confirmation page of my site, stock is deducted.

 

One issue though, the first stage in the order status list has a red cross next to it - Status: Preparing [PayPal IPN]

 

The next step has a green tick next to it confirming payment has succesfully been taken.

 

Any feedback would be apprecited.

 

Many thanks,

 

Rob.

Link to comment
Share on other sites

Hi,

 

I have installed osC Paypal IPN 1.1 and Downloads Controller 5.3.

 

The order status is updated correctly to "downloads available" but nothing is displayed and nothing can be downloaded.

 

I think the problem is that the table ORDERS_PRODUCTS_DOWNLOAD is empty.

 

Any thoughts?

 

Cheers,

Matt

Link to comment
Share on other sites

Generic Guide - if ipn.php is not updating the order

 

Symptoms: no order email, stock is not updated, order status is not updated

 

Possible causes

 

1. Register Globals

If your server requires you to have php.ini files in all directories then make sure that it was copied into the new /ext/ directory. Depending on your server set-up you may have to copy this into each folder level

2. Port

The ipn.php uses Port 443 for PHP versions 4.3 or higher and Port 80 for older versions. Check with your hosting provider what ports you can use & alter the ipn.php file accordingly.

 

3. Proxy server

If your hosting provider uses a proxy server (GoDaddy is a prime example) then you need to find out the IP address and apply the proxy fix as detailed in the user guide:

 

I hope this helps - Terra

 

 

1) I did not received any error message on the issue of register globals.

 

and for 2 and 3

 

This is the reply from my hosting provider.

 

2) The port for PHP is: 80 and if you have an SSL certificate on a dedicated IP then you can use port: 443

 

3) We don't use any proxy server or have any.

 

Is there any where else that i need to check on? Thank you.

Link to comment
Share on other sites

One issue though, the first stage in the order status list has a red cross next to it - Status: Preparing [PayPal IPN]. The next step has a green tick next to it confirming payment has succesfully been taken.

Rob - that's the correct behaviour. The first stage is the saving of the unpaid order and you don't want to send out anything at this stage. Only once payment has been confirmed are the order emails sent out. If you check the user guide, there's more information on unpaid orders & why it's necessary to save them. 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) I did not received any error message on the issue of register globals.

and for 2 and 3

This is the reply from my hosting provider.

2) The port for PHP is: 80 and if you have an SSL certificate on a dedicated IP then you can use port: 443

3) We don't use any proxy server or have any.

Is there any where else that i need to check on? Thank you.

Hi - make sure that in your PayPal account, the IPN is not switched on. Can you also confirm that you have a full SSL with dedicated IP and what version if PHP you are running?

 

To test if PayPal accesses the right file you can put a simple email at the top of the ipn.php file ... if you receive the email, then PayPal has found the file (which is good) but something has gone wrong in the communication between PayPal & your site (which is bad, but narrows down the problem). A simple email would work like this (but enter your own email address of course): mail('[email protected]', 'testing paypal', 'paypal has found the file');

 

Also - is the ipn.php file in the correct directory? If your site is in the root then the directory should start at the root /ext/...., if it's in a folder then it would be /folder/ext/ ....

 

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

quick question for you all, i really really hope someone knows what im talking about. we have paypal IPN and QTpro installed on my oscommerce. after the paypal ipn was installed QTpro would not automatically update the stock. it would be very, very convenient if we found a fix for this but i just cant seem to find one. any suggestions at all? it automatically updates if paypal ipn is not installed. i was told the fix was in this thread, but theres over 100 pages and was hoping someone could give me a quick link. any and all information would be greatly appreciated and thanks in advance for the help!

 

-ben

Link to comment
Share on other sites

Hi - make sure that in your PayPal account, the IPN is not switched on. Can you also confirm that you have a full SSL with dedicated IP and what version if PHP you are running?

 

To test if PayPal accesses the right file you can put a simple email at the top of the ipn.php file ... if you receive the email, then PayPal has found the file (which is good) but something has gone wrong in the communication between PayPal & your site (which is bad, but narrows down the problem). A simple email would work like this (but enter your own email address of course): mail('[email protected]', 'testing paypal', 'paypal has found the file');

 

Also - is the ipn.php file in the correct directory? If your site is in the root then the directory should start at the root /ext/...., if it's in a folder then it would be /folder/ext/ ....

 

all the best - Terra

 

 

 

I'm having the same problem.

 

- The site is running on port 80 and the ipn.php only has port 80 in it (I tried with 443, thinking it should ignore that, but neither way works). My client doesn't have SSL - it's a standard (port 80) website and he's using PayPal to try and keep costs down, letting the secure payment take place off his site. I know other sites that manage to do this using osCommerce.

 

- The ipn.php is in the correct location and has no Register Globals error

 

- I've tried the e-mail line, but nothing is coming through

 

 

 

This all leaves me at a complete loss to know what to try next. Any ideas gratefully received!

 

 

 

Best regards,

 

 

 

 

 

Adam

Link to comment
Share on other sites

I thought I had installed the Paypal IPN correctly. And through a vast majority of the instructions I had. But when I went to my admin page to turn it on, it now looks like:

 

http://www.tummytoys.com/adminhelp.gif

 

I have another contribution installed (PayPal WPP), but I'm careful to comment any code additions and didn't mingle the two at all. I've been beating my head against the wall for several hours now. Our website, tummytoys.com is still working, but the Refs for the admin tool are severly screwed up. Does anyone know what I did/overwrote/blew up to get this to happen?

 

Thanks much.

 

-Aaron @

Tummytoys.com

Link to comment
Share on other sites

I thought I had installed the Paypal IPN correctly. And through a vast majority of the instructions I had. But when I went to my admin page to turn it on, it now looks like:

http://www.tummytoys.com/adminhelp.gif

Aaron - check whether you mixed up any front-end & admin language files (e.g. english.php) when you uploaded. The Upper Case Constants you see means that your admin area can't find the language level information. 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

Terra,

 

Alright, I've used a bunch of different files and I can't get either the names or the links to work.

 

The link all look something like:

 

www.tummytoys.com/catalog/admin/FILENAME_CATEGORIES?selected_box=catalog

www.tummytoys.com/catalog/admin/FILENAME_CONFIGURATION?selected_box=configuration&gID=1

www.tummytoys.com/catalog/admin/FILENAME_CUSTOMERS?selected_box=customers

 

I replaced both the admin/index.php and the admin/includes/languages/english.php files and everything is still failing.

 

The error occured after I changed the admin files from my IPN install:

 

admin/includes/boxes/catalog.php ----------------------------------------------

 

line 29

replace

 

'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );

 

with

 

//kgt - discount coupons

'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.

'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );

//end kgt - discount coupons

 

 

admin/includes/database_tables.php --------------------------------------------

 

add

 

//kgt - discount coupons

define('TABLE_DISCOUNT_COUPONS', 'discount_coupons');

define('TABLE_DISCOUNT_COUPONS_TO_ORDERS', 'discount_coupons_to_orders');

//end kgt - discount coupons

 

 

admin/includes/filenames.php --------------------------------------------------

 

add

 

//kgt - discount coupons

define('FILENAME_DISCOUNT_COUPONS','coupons.php');

define('FILENAME_DISCOUNT_COUPONS_MANUAL', 'coupons_manual.php');

//end kgt - discount coupons

 

 

admin/includes/languages/english.php ------------------------------------------

 

add

 

//kgt - discount coupons

define('BOX_CATALOG_DISCOUNT_COUPONS', 'Discount Coupons');

//end kgt - discount coupons

 

Nothing in there strikes me as something that would destroy my admin tool, but I'm not a native PHP programmer, yet...

 

Aaron - check whether you mixed up any front-end & admin language files (e.g. english.php) when you uploaded. The Upper Case Constants you see means that your admin area can't find the language level information. Terra
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

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

Incorrect shipping rates transferred to paypal

 

I have UPS and USPS both shipping modules installed on my site. The UPS and USPS shipping modules both display the correct shipping charge in the oscommerce cart on my website but as soon as I am transferred to Paypal the shipping rate changes and the incorrect shipping rates are transferred to Paypal.

 

Does anyone have any idea whats going on or any suggestions ?

Link to comment
Share on other sites

Hi - make sure that in your PayPal account, the IPN is not switched on. Can you also confirm that you have a full SSL with dedicated IP and what version if PHP you are running?

 

To test if PayPal accesses the right file you can put a simple email at the top of the ipn.php file ... if you receive the email, then PayPal has found the file (which is good) but something has gone wrong in the communication between PayPal & your site (which is bad, but narrows down the problem). A simple email would work like this (but enter your own email address of course): mail('[email protected]', 'testing paypal', 'paypal has found the file');

 

Also - is the ipn.php file in the correct directory? If your site is in the root then the directory should start at the root /ext/...., if it's in a folder then it would be /folder/ext/ ....

 

all the best - Terra

 

 

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?

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