Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - Devosc

Recommended Posts

i tried this and it still came up with a error, so i simply set up a norma href to the page directly and although it (the link) shows up all the time even when the category isnt selected, i dont mind.

 

its a hash, but it works ;)

 

thanks anyhoo


"because it'll hurt more"- the greatest film of all time?

Share this post


Link to post
Share on other sites

I kept getting people who didn't know what PayPal was emailing me asking if I accepted Credit Cards, so I changed the payment selection screen to show an image of credit cards instead of it just saying paypal which looks like this:

 

mod_payment_type.jpg

 

as oppossed to the orig screen which is this:

orig_payment_type.jpg

I did this by changing two lines in /includes/languages/english/modules/payment/paypal.php as follows:

 

Copyright (c) 2002 osCommerce
 Copyright (c) 2004 DevosC.com

 Released under the GNU General Public License
*/

 define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE', '<IMG SRC="/store/images/pp.jpg">');
 define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION', '<IMG SRC="/store/images/pp.jpg">');

//begin PayPal_Shopping_Cart_IPN

 

as oppossed to the orig code which is this:

 

Copyright (c) 2002 osCommerce
 Copyright (c) 2004 DevosC.com

 Released under the GNU General Public License
*/

 define('MODULE_PAYMENT_PAYPAL_TEXT_TITLE', 'PayPal');
 define('MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION', 'PayPal');

//begin PayPal_Shopping_Cart_IPN

 

This seems to work fine and I have had no problems with getting orders and payments but I just noticed that because of changing that small detail it changes my admin order screen to make it look like any other order type, Check, Cash etc... instead of the PayPal IPN one. This is the orig screen:

 

mod_admin_order.jpg

 

and this is what I now get by changing to the image for the title and description:

 

orig_admin_order.jpg

 

I'm thinking that its got to be in a definiton somewhere that MODULE_PAYMENT_PAYPAL_TEXT_TITLE 'PayPal', and or MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION 'PayPal' reference to make the admin order screen change, I just cant figure out where it is or how to fix it . Any help would be greatly apprecieated and be a great benifit to us all

Thanks in advance

~Steel~

Share this post


Link to post
Share on other sites

Hello all, I discovered osCommerce about a week ago and set it up on a testing server to get to know it. I am going through the contributions and trying to get to know them as well. PayPal_Shopping_Cart_IPN looks like a great contribution. My question to the group is, has anyone been able to get PayPal_Shopping_Cart_IPN to work with Basic Template Structure - BTS? So far I have not had any luck, but since I am a OSC newbie it may be operator error.

 

I will also post on the BTS support forum.

Share this post


Link to post
Share on other sites

Steel, try, in admin/orders.php

 

find, or make suitable adjustments, such that you change:

strtolower($order->info['payment_method']) == 'paypal'

To:

strtolower($order->info['payment_method']) == strtolower(MODULE_PAYMENT_PAYPAL_TEXT_TITLE)

 

cool_fritz, there shouldn't be any problems with that one.

Edited by gregbaboolal

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

Share this post


Link to post
Share on other sites

Steel, my customers have gone through a similar fog of confusion with PayPal versus Credit Cards. Here's my latest solution:

 

creditcardlogos3.gif

 

The [info] popup message is: http://www.visibone.com/catalog/CreditCardExplain.html

 

EVEN SO, I just talked with a customer today who thought the Payment Details screen was a PayPal login screen. My theory is people only read the titles of the entry fields, filling in whatever is thrown at them. I know I get that way.

 

I am very close to giving up with PayPal as a general-purpose credit card payment processor (though not as a PayPal payment processor). The above tweaks have helped a good deal with the confusion problem, but there's another problem, even more insidious. This cruel PayPal error message:

 

ccalready.gif

 

In other words, PayPal members cannot use their credit cards or email addresses to make a purchase in your store. It's downright sadistic, especially when it blows away a whole screen of order data entry (that page has a short timeout). I posted several customer flames about this on paypaldev.org.

Share this post


Link to post
Share on other sites

thanks for the help i have tried what you suggested gregbaboolal

but still no luck

and Bob Stein, VisiBone I realy like your pop up what code and where did you put that in to make it display?

 

Thanks

~Steel~

Share this post


Link to post
Share on other sites

Stevel, not sure right now without testing more again, earlier, when reading through, I had thought it was because that text was/is being stored, as the payment_method. Try debugging all 3 (?) of those statements by echoing out $order->info['payment_method'].


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

Share this post


Link to post
Share on other sites

when i try to delete an order and restock the item i get this error

1146 - Table 'mharpboo.TABLE_PAYPAL' doesn't exist

 

delete from TABLE_PAYPAL where paypal_ipn_id = '2'

 

[TEP STOP]

 

i dont understand this, any help is great thanks

 

mike


"because it'll hurt more"- the greatest film of all time?

Share this post


Link to post
Share on other sites

Hi all

 

I have recently installed the paypal ipn 2.4 (had 2.2 before)

 

and I recognized that as soon an order is placed and also payed the data is not updated in the db table orders correctly.

 

before the payment_class, shipping_method and shipping_class was set correctly (with version 2.2) and now nothing is entered anymore (NULL).

 

What should I do, what do I have to change?

 

Thanks for any help

Kai

Share this post


Link to post
Share on other sites

Thanks for asking for the code to the [info] popup help in the credit card logo implementation, Steel.

creditcardlogos3.gif

 

Old code in catalog/checkout_payment.php:

 

                    <td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td>

 

New code in catalog/checkout_payment.php:

 

                    <td class="main" colspan="3" nowrap><?php
                     if ($selection[$i]['module'] == 'PayPal') {
                       ?>
                         <big><b>
                           Credit Card
                             <img src="https://www.paypal.com/en_US/i/logo/logo_ccVisa.gif"     border="0" title=" Visa "             alt="Visa"            align="bottom">
                             <img src="https://www.paypal.com/en_US/i/logo/logo_ccMC.gif"       border="0" title=" MasterCard "       alt="MasterCard"      align="bottom">
                             <img src="https://www.paypal.com/en_US/i/logo/logo_ccDiscover.gif" border="0" title=" Discover "         alt="Discover"        align="bottom">
                             <img src="https://www.paypal.com/en_US/i/logo/logo_ccAmex.gif"     border="0" title=" American Express " alt="American Express"align="bottom">
                           or
                             <img src="https://www.paypal.com/en_US/i/bnr/banner_intl.gif"      border="0" title=" PayPal "           alt="PayPal"          align="bottom">
                         </b></big>
                           <br>
                           You do not need to be a PayPal member to pay by credit card.
                           <script>
                             document.writeln('<a style="cursor:hand" onclick="javascript:popup=window.open('
                                            + '\'http://(your domain here)/catalog/CreditCardExplain.html\',\'popup\','
                                            + '\'scrollbars,resizable,width=500,height=600,left=50,top=50\'); popup.focus(); return false;">'
                                            + '<font color="blue"><u>[info]</u></font></a>');
                           </script><noscript>
                             <a href="CreditCardExplain.html" target="_blank"><font color="blue"><u>[info]</u></font></a>
                           </noscript>
                       <?php
                     } else if ($selection[$i]['module'] == 'Check/Money Order') {
                       ?><big><b>Check or Money Order </b></big>
                         <img src="https://(your domain here)/(some folder)/check.gif" border=0 alt=" Send Us a Check " align="absmiddle">
                       <?php
                     } else {
                       echo '<big><b>' . $selection[$i]['module'] . '</b></big>';
                     }
                   ?></td>

 

This is the whole thing, including bigger bolder terminology, and an image for pay-by-check. Look for the <script> ... </script><noscript> ... </noscript> sections if all you want is the [info] popup. (Say isn't this spooky? It's JavaScript inside HTML inside JavaScript inside HTML inside PHP inside HTML.)

 

(Sorry this looks messy, but the indentation is ready to drop in. It looks better if you have a very wide screen to stretch it out to the right. Personally I like code that never goes beyond column 79, but that's sure not the oscommerce way...)

Share this post


Link to post
Share on other sites

Mike, make sure you have the require statement in admin/includes/database_tables.php per install docs.

 

saletco, can you verify that the install/upgrade was done properly.

 

Bob (and et al), the normal method for adding supplementary info to a paypment option is to amend that payment module appropiately, for paypal, in catalog/includes/modules/payment/paypal, one could change

 

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

To:

    function selection() {

     $img_visa = 'https://www.paypal.com/en_US/i/logo/logo_ccVisa.gif';
     $img_mc = 'https://www.paypal.com/en_US/i/logo/logo_ccMC.gif';
     $img_discover = 'https://www.paypal.com/en_US/i/logo/logo_ccDiscover.gif';
     $img_amex = 'https://www.paypal.com/en_US/i/logo/logo_ccAmex.gif';
     $img_paypal = 'https://www.paypal.com/en_US/i/bnr/banner_intl.gif';
     $cc_explain_url = tep_href_link('CreditCardExplain.html', '', 'SSL');
     $cc_explain_txt = '<u>[info]</u></font>';
     $fields[] = array('title' => '', //MODULE_PAYMENT_PAYPAL_TEXT_TITLE,
                     'field' => '<div><b>' .
                      'Credit Card ' .
                      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"') .
                      ' or ' .
                      tep_image($img_paypal,' PayPal ','','','align="absmiddle"') .
                      '</b></div>' .
                      '<div>' .
                      'You do not need to be a PayPal member to pay by credit card ' .
                      '<script>'."document.writeln('<a style=\"cursor:hand;\" href=\"javascript:{};\" onclick=\"javascript:{popup=window.open(\'" . $cc_explain_url . "\',\'popup\',\'scrollbars,resizable,width=500,height=600,left=50,top=50\'); popup.focus(); return false;}\"><font color=\"blue\">". $cc_explain_txt ."</a>');".
                      '</script>'.'<noscript><a href="' . $cc_explain_url . '" target="_blank"><font color="blue">' . $cc_explain_txt . '</noscript>' ."\n".
                      '</div>');

     return array('id' => $this->code,
                  'module' => $this->title,
                  'fields' => $fields);
   }

This will replicate the above, but not exactly because it will still maintain the Payment Title Name, eg. PayPal.

Also bear in mind that the verbatim text is in english.

Also hotlinking the images isn't really the best thing to be doing, as opposed to being stored locally.

Edited by gregbaboolal

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

Share this post


Link to post
Share on other sites

Bob Stein, VisiBone

 

That worked like a charm!!!!!! and its alwsome!

I realy think you should put that coding on the contrib site so every one can see it. It will help people not just for PayPal checkouts but for any other modifications that anyone would want to make to the checkout payment screen! (and btw that is scary LOL)

 

Thanks Again!

 

~Steel~ :D

Share this post


Link to post
Share on other sites

gregbaboolal,

I do agree hotlinking an image can be a problem, the link can change anytime and it uses someone elses bandwith so I have changed to coding to link images localy from my server. Also I have tried the way you had the coding listed which is also good thank you very much for your help but I think I prefer the way Bob Stein, VisiBone had it listed. Doing it his way makes it less confusing to the customers (which already seemed confused enough LOL) by keeping it all on the same line and focusing more on it being Credit Card then PayPal. Also by using his you can modify all the payment methods using the {if else} commands for all the payment types not just paypal. Its actully more of what I was trying to do. Thank You Both! This is what Forums are all about us helping each other!

 

Thanks Again

~Steel~

 

Also Bob Stein, VisiBone, I still think you should list the coding in the contrib section alot of people would benifit from it. Although, I would also change it to list the images localy.

 

KEEP UP THE GREAT WORK!!! :D

Share this post


Link to post
Share on other sites

Bob Stein, VisiBone,

I have taken the code you listed, all the image files, the html file, and a screen shot, and put it all in a zip file. If you like I will send it to you so you can add your name and whatever else you would like, to it making it easier for you to put on the contrib site. I think your small but good mod will help people that much.

~Steel~

Share this post


Link to post
Share on other sites
Dawn, what happens when you send a test IPN, do you get a blank page?

Hi Greg. :) Ok, just to clear up in case I'm having a blond moment....

 

I do the test page by creating a customer and then checking out? Or by using John Doe? Can't use John Doe, need to log on or create an acct and don't know Mr. Doe's password.

 

So I created a new customer and checked out and that's where the no IPN problem comes up. So until I get the IPN # I can't run the test page? Or is that incorrect?

 

I know this test is supposed to be simple but I'm overlooking something.

Bumping for advice. and yes, got a blank page when I ran the test.

 

Any suggestions?

Share this post


Link to post
Share on other sites

Still no IPN and getting a blank test page. Searched through the forum and seems a lot of people have this problem. I tried every piece of advice I could find and still can't get it work. Then spent over an hour in PayPal's site viewing IPN tech notes (and I learned a lot).

 

Now I have a stupid question.... in PayPal (not oscommerce) when you set up the IPN and have to give a URL, what URL do you give? Your domain name, a specific page from the oscommerce catalog? Hoping it's something that simple to fix this.

 

I don't know what else to try. I haven't even gotten started on trying to get the files people purchase to download for them. 3 months working on this thing to set it up. I feel like a 5-yr-old in high school trying to do algebra while my brain will only take in 1+1. I'm not totally illiterate, just new to php and mysql and oscommerce. I'd do straight html PayPal (like I have been for 2 yrs) but I need my customers to be able to download their purchases without me having to intervene for every purchase. :huh:

 

Please, please, take pity on me and offer advice if any of you have overcome this little obstacle. I have a lovely horizontal bruise from banging my head against my desk for so long. :blink:

Share this post


Link to post
Share on other sites

Hello>

 

I've encountered another couple of glitches with my installation.

 

I'm trying to run the test page so I can verify that the process works, the test page link shows up at the status bar at the bottom of the page, but then I'm redirected to a 404 page. Where could this problem be ID'd?

 

Also, when I click on PayPal IPN under the Customers section in the osC admin, I also get thrown a 404.

 

I know I probably screwed up on the installation somewhere, but where?

 

Thank You.

 

Mario.

Share this post


Link to post
Share on other sites

Ok, I installed the Paypal IPN over the weekend & a client made a purchase paying wiht a gift voucher & the remainder by Chq/MO.

 

Upon reviewing the transaction, I noticed that no shipping charges or taxes where charged to my client.

 

I have no idea how to fix this or even where to begin.

 

Modules Sort Order Action 

Discount Coupons 9 

Gift Vouchers 740 

Low Order Fee   

Shipping 2 

Sub-Total 1 

Tax 3 

Total 900 

 

Above you will see what I have set up as my sort order. I hope that it's an easy fix so I can get this resolved.

 

Thank you!


Joel Gallant

Share this post


Link to post
Share on other sites

Just to add, I also noticed that it's not pulling the delivery address forward.

 

 

5 Alarm Gifts

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

Order Number: 9

Detailed Invoice: ****** (removed)

Date Ordered: Monday 28 June, 2004

 

Hey it's me...

 

Products

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

1 x 6-Piece Wood Bucket Bath Set (28061) = 14.95CAD

1 x Vanilla Milk Bath Set (34183) = 19.95CAD

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

Sub-Total: 34.90CAD

Gift Vouchers: 20.00CAD

Total: 14.90CAD

 

Delivery Address

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

 

 

,

 

 

Billing Address

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

**** *******

** *** ******

St-Leonard, ******

NB, Canada

 

Payment Method

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

Check/Money Order

 

Make Payable To: Joel Gallant

 

Send To:

5 Alarm Gifts

530 A St-Francois St

Edmundston, NB

E1A 4Z5

506-870-0054

 

Your order will not ship until we receive payment.

 

 

So, I have no idea if this has to do with the fact that my shipping/taxes didn't get charged.

 

Now, I have no idea what I'd be looking at if I was to compare files or anything... So, someone is going to have to *baby set* me through it.... I know the basics of it, but going to need to get some help!

 

Thanks to anyone who's giong to reply with help!


Joel Gallant

Share this post


Link to post
Share on other sites

I am also not getting the IPN listed at all in the admin area... thus, I cannot test with the test page. I have installed this mod on 3 diff sites. None of the sites are getting order emails when a paypal order is placed. I have the primary email addy set correctly on all 3 sites. :( Any help would be greatly appreciated!! Thanks.

 

Shanna

Share this post


Link to post
Share on other sites
Quickbooks IIF modification for Paypal IPN v2.4

 

I just updated my Paypal contrib from v1.7 to v2.4.  Thanks Greg for all the hard work!  This is a great contrib!!

 

The only issue I have to resolve now is with the Quickbooks IIF file generation contrib I have installed.  I use Quickbooks accounting software, and it works great.  For every transaction that is processed through our system, the corresponding information is created in a file that can then be downloaded into Quickbooks for accounting purposes.

 

When I was running Paypal IPN v1.7, I had the following statement inserted in catalog/ipn.php:

// Quick Books
if (CREATE_SALE_QB_IIF_FILE) {include(DIR_WS_INCLUDES . 'qb_iif_sale.php');}

This statement was located in catalog/ipn.php right after this code:

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
$sql_data_array = array('orders_id' => $insert_id, 
? ? ? ? ? ? ? ? ? ? ? ? 'orders_status_id' => '99999', 
? ? ? ? ? ? ? ? ? ? ? ? 'date_added' => 'now()', 
? ? ? ? ? ? ? ? ? ? ? ? 'customer_notified' => $customer_notification,
? ? ? ? ? ? ? ? ? ? ? ? 'comments' => $order->info['comments']);
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

The Quickbooks statement above invoked the Quickbooks mod to write the transaction information to the Quickbooks IIF file once the transaction was complete.

 

With Paypal IPN v2.4, the file catalog/ipn.php is completely changed.  So, I'm hoping someone can tell me where I should insert this Quickbooks statement within the new Paypal IPN v2.4 contribution.  As I'm not exactly sure how the new Paypal IPN works, is there someone out there that can tell me where I could install this line?

Hi Greg,

 

I inserted my Quickbooks line in the checkout_update.php file, and now the QB file gets generated. However, I am not getting all the data written to the QB file, which I imagine is due to the fact that all the variables concerning the purchase aren't available from the checkout_update.php.

 

Could you advise how to make the variables available for the Quickbooks contrib. I basically need everything concerning the order, including all the customer information and all the transaction information.

 

Thanks,

Craig

Share this post


Link to post
Share on other sites

hi just added this contribution but i need a specific functionality

i am trying to allow the customer to enter a gratuity[tip] to the order total i have no delivery options since everything is local delivery and am using paypal and cod as my only form of payment. The tip has to be added only to paypal payment .i would appreciate if you point me to the right direction

Share this post


Link to post
Share on other sites
I inserted my Quickbooks line in the checkout_update.php file, and now the QB file gets generated.  However, I am not getting all the data written to the QB file, which I imagine is due to the fact that all the variables concerning the purchase aren't available from the checkout_update.php.

 

Could you advise how to make the variables available for the Quickbooks contrib.  I basically need everything concerning the order, including all the customer information and all the transaction information.

Concerning this issue, I found that the variables that are not being accessed properly are from the shopping cart. The following lines of code are contained in a file qb_iif_sale.php that is invoked inside includes/modules/payment/paypal/checkout_update.php:

$products = $cart->get_products();

and

for ($t=0; $t<sizeof($order->products); $t++)

Specifically, the FOR loop that is executed in the above line of code is NOT executed when this file is called from checkout_update.php. I assume that this is because, with the restructuring of the Paypal IPN module, the cart information is no longer available (or the cart doesn't exist) at the time that checkout_update.php is called.

 

Therefore, can you advise on how to pull up the cart/order data from this point in the checkout process?

 

Thanks,

Craig

Share this post


Link to post
Share on other sites

Mysterious PayPal IPN delays today?

 

Noticed PayPal IPN coming in 3 hours late. Checked PayPal transaction details and raw log files -- order was consummated 14:44 local, IPN came in 17:57 local. Greg I seem to recall you mentioning there could be a delay? Sure is disconcerting having gotten used to seeing it "Instantly".

 

Several other orders are still awaiting IPN...

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
Sign in to follow this  

×