Jump to content
Sign in to follow this  
osmosis

PayPal IPN v0.97 released

Recommended Posts

I am using osCommerce 2-2CVS.

 

Will this contribution Paypal IPN work with it.

 

I would like to install it, but if it is not compatible, then.


BG

 

Making the internet community better. Knowledge is power.

Share this post


Link to post
Share on other sites

Yeah!

 

After working on this for half the day, I got it posting an actual PP shopping cart! With Attributes, prices etc.

 

Keep in mind, this was done specifically for my site. I can't guarantee this will work for all sites, but it will get you going in the right direction.

 

At the very bottom of checkout_paypalipn.php find this

tep_redirect("https://www.paypal.com/cgi-bin/webscr?cmd=_ext-enter&redirect_cmd=_xclick&business=".MODULE_PAYMENT_PAYPALIPN_ID."&item_name=".urlencode(STORE_NAME)."&item_number=".$insert_id."&currency_code=".$paypal_ipn_currency."&amount=".$paypal_ipn_order_amount."&shipping=".$paypal_ipn_shipping_amount."&tax=".$paypal_ipn_tax_amount."&first_name=".urlencode($order->customer['firstname'])."&last_name=".urlencode($order->customer['lastname'])."&address1=".urlencode($order->customer['street_address'])."&city=".urlencode($order->customer['city'])."&state=".urlencode($order->customer['state'])."&zip=".urlencode($order->customer['postcode'])."&email=".$order->customer['email_address']."&bn=oscommerce-osmosis-0.971m1&return=".tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')."&cancel_return=".tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')."&notify_url=".MODULE_PAYMENT_PAYPALIPN_NOTIFY_URL);

 

and replace with this

 

////derek



 global $order, $currencies, $currency; 

 

if (MODULE_PAYMENT_PAYPALIPN_CURRENCY == 'Selected Currency') { 

 $my_currency = $currency; 

} else { 

 $my_currency = substr(MODULE_PAYMENT_PAYPALIPN_CURRENCY, 5); 

 } 

if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { 

 $my_currency = 'USD'; 

	 } 



$process_button_string ='?';

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

 $x=$i+1;

 $process_button_string .= 

 'item_name_'.$x.'='.urlencode($order->products[$i]['name']) .'&'. 

 'quantity_'.$x.'='.$order->products[$i]['qty'] .'&'.

 'amount_'.$x.'='.$currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) .'&'. 

 'shipping_'.$x.'='.number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)).'&';



   if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

     for ($j=0, $n2=1; $j<$n2; $j++) {

 $process_button_string .= 'on'.$j.'_'.$x.'='.urlencode($order->products[$i]['attributes'][$j]['option']) .'&'. 

 'os'.$j.'_'.$x.'='.$order->products[$i]['attributes'][$j]['value'] .'&';

         }

      }    

 } 

 $process_button_string .= 

 'cmd=_cart&'.

 'upload=1&'.

 'business='.MODULE_PAYMENT_PAYPALIPN_ID .'&'. 

 'return='.tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL').'&'. 

 'cancel_return='.tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL').

 '&tax='.$paypal_ipn_tax_amount.

 '&first_name='.urlencode($order->customer['firstname']).

 '&last_name='.urlencode($order->customer['lastname']).

 '&address1='.urlencode($order->customer['street_address']).

 '&city='.urlencode($order->customer['city']).

 '&state='.urlencode($order->customer['state']).

 '&zip='.urlencode($order->customer['postcode']).

 '&email='.$order->customer['email_address'].

 '&notify_url='.MODULE_PAYMENT_PAYPALIPN_NOTIFY_URL; 

 

///derek



//echo "$process_button_string";

tep_redirect("https://www.paypal.com/cgi-bin/webscr".$process_button_string);

 

Would like to know how it works out for others. This is my first hack for OSC. If it can be improved upon, please let me know as well.

 

Derek

http://www.7thgencivic.com

Share this post


Link to post
Share on other sites

I get the ipn notificatio, but it never creates the invoice in oscommerce, so I have no clue what the person ordered. Any ideas?

Share this post


Link to post
Share on other sites

I am having several problems tyring to get this to work.

 

My first occurs when I enable PayPal IPN in admin>modules>payment, I get this error:

Warning: call_user_func(tep_get_order_status_name) [function.call-user-func]: First argument is expected to be a valid callback in /catalog/admin/includes/functions/general.php on line 1232

 

If I try to edit my PayPal IPN information in admin>modules>payment, I get this error:

Fatal error: Call to undefined function: tep_cfg_pull_down_order_statuses() in /catalog/admin/modules.php(204) : eval()'d code on line 1

And it won't let me edit anything.

 

The third problem I see, is when I go to admin>paypalipn>transactions, I get several errors:

Warning: session_start() [function.session-start]: The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9 in /catalog/admin/includes/functions/sessions.php on line 67



Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /catalog/admin/includes/functions/sessions.php:67) in /catalog/admin/includes/functions/sessions.php on line 67



Warning: Unknown(): The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9 in Unknown on line 0



Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

 

Does anybody have any idea what I did wrong? I did an overwriteandrun installation, and successfully added all database requirements. I am using paypalipn_v0971.

 

All help is appreciated.

 

Thanks


Lee

 

"Pleasure in the job puts perfection in the work" -- Aristotle

Share this post


Link to post
Share on other sites

installed on a fresh 2.2 milestone 1 and 0.971 of PayPal IPN and doesn't work.

 

It Does:

1. Add order to admin when user leaves for paypal with status of "Paypal Pending"

 

 

It Doesn't:

1. Change status from Paypal Pending

2. If I make order and goto paypal, turn testing on in admin, run test_ipn with orderID, I get email an email, order is just gone in admin, and stock is not deducted.

3. Run it like a regular order, pay at paypal, cart isn't notified of payment, status stay paypal pending, and no order email is sent. (I used the default http://www.kinetixrc.com/catalog/paypal_notify.php which is accurate on paypal ipn section).

 

I am back to the stock paypal for now.

Share this post


Link to post
Share on other sites

And it doesn't clear the cart when I come back from paypal from clicking the contiune button.

Share this post


Link to post
Share on other sites

Interesting, I turned off cURL and now I have different results.

 

1. When going to paypal page to pay, adds order and makes status Paypal Pending

2. When order is paid, the stock is changed, but the order is no longer in orders (All Orders, is selected), it just disappears, but it is being shown in the paypal ipn transaction, and no addresses are sent in the email to me but show up in the transaction details in paypal ipn.

 

Basically I need to know where the order disappeared to so I can print out the invoice and update them when it is shipped.

Share this post


Link to post
Share on other sites

Have MS1 just installed paypal mod and this is the errors I get:

 

Warning: session_start() [function.session-start]: The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9 in /home/bares/public_html/admin/includes/functions/sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/bares/public_html/admin/includes/functions/sessions.php:67) in /home/bares/public_html/admin/includes/functions/sessions.php on line 67

 

 

Warning: Unknown(): The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9 in Unknown on line 0

 

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

 

 

I've doubled checked everything and I can't find a problem.

Share this post


Link to post
Share on other sites

Ok I uninstalled all paypal mods and replaced with my original files and I'm still geteting the above errors and I can't do anything on admin now. PLEASE HELP!

Share this post


Link to post
Share on other sites

[MS 2.2-MS1 + PayPal IPN 0.971]

 

To fix those session errors, I copied catalog/includes/functions/sessions.php over admin/includes/functions/sessions.php.

 

The two files are nearly identical, but the former appears to be a later version, and uses !empty instead of !='' in a few places.

Share this post


Link to post
Share on other sites

Well, that didn't work very well.

 

Had 0.96 as part of the loaded snapshot and had it working. Decided I wanted the new email features of 0.971, so I went and tried to upgrade it. Tried upgrade database and changing files manually. Got the error about /tmp, so I changed to using mysql for temp sessions. Fixed that issue. Then had issue with test not working, so I killed the IPN related databases and rebuilt them using the sql script in 0.971.

 

I got it working (sorta) but have 2 problems....

1) When editing the configuration in the payment module part of the admin utility, there are 4 text boxes with no descriptions or values. No idea what is up with that. Seems I must have an incorrect file or something there but don't know what it could be.

 

2) When processing an order, all works fine for COD. Then I try using IPN. When I confirm the order, it gets added to the order list and I am sent off to PayPal to pay. Once I make the payment, it reflects properly in the IPN transaction list (verified) and emails are sent, HOWEVER my order disappears from the list of orders, and the order emails don't have shipping info in them.

 

Any thoughts would be REALLY appreciated. Thanks in advance.

Rick

Share this post


Link to post
Share on other sites

Those are all the same problems I am having, and still haven't figured it out. I have uninstalled, reinstalled and replaced about every file in my store. I even tried it on a clean install of oscommerce and had all the same problems.

 

 

Hopefully there will be a fix or a new release fixing these problems soon.


Lee

 

"Pleasure in the job puts perfection in the work" -- Aristotle

Share this post


Link to post
Share on other sites

Well since nobody has any idea why these problems exist or how to fix them, can somebody enlighten me on the "security" issue associated with the paypal payment option that is included with osCommerce. I was told to use paypal IPN because of a security problem with the osCommerce paypal module.

 

I really need to get a payment module going soon and want to make sure I won't be comprimising customer information.

 

Thanks


Lee

 

"Pleasure in the job puts perfection in the work" -- Aristotle

Share this post


Link to post
Share on other sites

:D Hi all :!:

 

I've just installed the latest beta version of PayPal IPN.

 

And then logged into Admin.

 

Got the error messages:

 

In the PayPal catagory at the bottom left hand side = "Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0"

 

And also in the Modules catagory I get the famous error - "Warning: call_user_func() expects first argument, 'tep_get_order_status_name', to be a valid callback in /home/ndonnell/public_html/oscommerce/admin/includes/functions/general.php on line 1232"

 

I've gone by the book to install this contrib, and also I've checked it over.

 

Could someone please point me in the right direction to solve this problem? Pleeeeeeease :?:

 

Cheers,

 

Neil. :P

Share this post


Link to post
Share on other sites

PLease help me. This is the errror message I get when I try to install paypalipn.sql with PhpMyAdmin which is located in My Control Panel.

What should I do? :?

 

Error

 

SQL-query :

 

INSERT INTO `orders_status`

VALUES ( 99999, 1, 'Paypal Processing' )

 

MySQL said:

 

 

Duplicate entry '99999-1' for key 1

Back

Share this post


Link to post
Share on other sites
PLease help me. This is the errror message I get when I try to install paypalipn.sql with PhpMyAdmin which is located in My Control Panel.

What should I do? :?

 

Error

 

SQL-query :

 

INSERT INTO `orders_status`

VALUES ( 99999, 1, 'Paypal Processing' )

 

MySQL said:

 

 

Duplicate entry '99999-1' for key 1

Back

 

Have you installed paypal IPN before, or in your database in the table orders_status is there that value ??

Share this post


Link to post
Share on other sites

No I have not installed it before.

Where should I find the order_status is it the 99999 I have to change?

Thanks for such a quick response :D

Share this post


Link to post
Share on other sites

Update.

I have found order_status :

Showing rows 0 - 3 (4 total)

 

SQL-query : [Edit] [Explain SQL] [Create PHP Code]

SELECT `orders_status_id` , `language_id` , `orders_status_name`

FROM `dewandbu_dew`.`orders_status`

WHERE `orders_status_id`

LIKE '%99999%' OR `language_id`

LIKE '%99999%' OR `orders_status_name`

LIKE '%99999%' LIMIT 0 , 30

 

 

Then I can delete and edit below.

Should I delete or edit?

Share this post


Link to post
Share on other sites

Sorry couldn?t wait. Tried do delete it and paypalipn_txn and it worked but it is still not available in My Module - Payment. :?

Share this post


Link to post
Share on other sites

Using the milestone release and setting up via Install instructions I try to process anIPN test but receive this error:

 

"Error: no $paypal_response received."

 

My path to aypal_notify appears correct. My id is in.

 

What is the Instant Payment Notification (IPN) URL file on the website of paypal? Is it paypal_notify.php?

 

Thanks

Share this post


Link to post
Share on other sites

First question... Is the author of this contribution still around? I think his wife had a baby a couple months ago. I haven't seen him post since.

 

Second Question/Issue:

 

PayPal IPN is installed and seems to be working... sort of. I'm seeing the PayPal IPN Transaction show up, but there is no customer order. I've tried it in test mode, and I had a friend of mine help me test it in live mode using his PayPal account. Even in live mode, there is still no order, but there is an IPN Verified transaction.

 

Is there anything else I'm supposed to set up in my personal PayPal Profile, or is this thing just supposed to automatically work? Please help.

Share this post


Link to post
Share on other sites

Well, after beating my head against the wall for the last few days, I finally got somewhere..... The problems I was having:

1) Orders disappearing after paying via PayPal

2) Blank config items in IPN administration

3) Blank addresses in order emails

 

I solved 1 by changing the default order status to "PayPal Processing" from the default - thanks to The Grinch who so eloquently figured it out. :wink:

 

I solved 2 by turning off the IPN module and turning it back on. Thanks to someone in this thread for that hint... Note: be sure to reset your paypal id or you will send money to you@yourbusiness.com.

 

I haven't solved 3 yet, but they are working on it at: http://forums.oscommerce.com/viewtopic.php...er=asc&start=10

 

For the time being, I will simply choose the lazy way as one guy pointed out, and refer them to the site or PayPal receipt if they need more info.

 

Hope that helps. I think it at least makes it useable, albeit still with one issue.

 

Oh- FYI - I am using MS1 loaded snapshot 5, upgrading to 0.971 of the IPN module. See my earlier post for info on what I did there, if needed.

Rick

Share this post


Link to post
Share on other sites

Hello everyone :D

 

Got a question.

 

If the order is not completed, the order goes into the DB with order status of 99999. Is there a way to change that?

I wanna make it to a different value.

I have looked everywhere I could think of and can't find it.

 

Your help would be appreciated!

 

Thanks :wink:


Emerson

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  

×