Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal_Shopping_Cart_IPN


devosc

Recommended Posts

I just don't get past the pending payment for the order. And yes, I did upload the /catalog/ipn.php as well. Any other tips Greg? I'd like to haev it completely working, but this is definitely better than the internal Paypal method, which left me without order info at least 3-4x already... thanks!

Link to comment
Share on other sites

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Greg (or anyone else w/ the answer!),

First-- great contrib. I like the debug setup on 2.0. Nice touch.

Second-- thanks for supporting your work so well. Much appreciated.

Third-- help!

 

Used the default paypal mod a week ago. 1st customer didn't click all through paypal to finish, so orders didn't show. He tried again (refunded), it worked 2nd time.

Installed your 1.7 hoping for better results. No orders posted back to my admin at all, no matter what.

Installed 2.0 on Apr 1 (great install instructions!), no change. Debug emails show all kinds of good stuff, as if everything is correct, but nothing in the orders again (plus their cart is empty).

Just to mention, using itemized, the paypal charge shows as full price to the customer if I have given them a coupon code. The debugs show reduced price, though. Going to aggregate shows correct price throughout.

 

Any ideas why nothing would show in the orders even though everything else seems to work? And I have done everything previously mentioned.

 

--Jeff

Link to comment
Share on other sites

Aw, heck. I forgot to ask the question I really wanted to:

Is there any more detailed instruction anywhere on how to do the "testing" of the paypal system, since I can't pay myself (and to use my customer's transactions as tests gets, well, bothersome after a while)?

--Jeff

Link to comment
Share on other sites

Thanks Mike(s).

 

FastEddie, try the test that Jeff is talking about:

 

In admin->modules->payment->paypal set it to test mode.

 

Start checking out as a customer, you'll need to know what the order number* is going to be (phpMyAdmin or even the admin section should give and idea), stop once you get as far as being transfered to the PayPal site.

 

Open up another browser, and load up the samples/ipn_tests/ipn.html page found in the contrib zip, you will need to make sure that it's form action is pointing to correctly to your catalog/ipn.php script, easiest if you just put in the directory.

 

Now enter the order number in the 'custom' field and hit enter, if all goes well you should only see a screen dump of the vars you just posted as an ipn. Hopefully there shouldn't be any error msgs.

 

The orders status should now be updated and the emails sent.

 

If you try to make another test transaction you will need to change the txn_id number, but it must still remain the same length, i.e. 17 chars.

 

A word of caution, I started to think now about how to better verify a transaction, i.e. cart total, currency, and number of items, even though PayPal might validate the transaction currently doesn't mean the details of the products are correct as might you gather from the above test, but this means that we can no longer use the itemized shopping cart since this information can be changed by the customer on the PayPal site because it is effectively a shopping cart, i.e. they are allowed to remove items and to change quantities, hence if a more thorough check is done in terms of the initial order as to what then might of changed on the PayPal site, this would throw out the transaction as being tainted, it would be nice if PayPal could allow us to use their Itemized Shopping Cart but not let it be editable by the customer.

 

Also, I found a bug in catalog/includes/modules/payment/paypal/ipn.php:

Find:

$paypal_https_response = @file('https://'.$domain.'/cgi-bin/webscr?'.$this->_response_string);
$paypal_response = @$paypal_https_response[0];

And change to:

$fp = @fopen('https://'.$domain.'/cgi-bin/webscr?'.$this->_response_string,'r');
$paypal_response = @fgets($fp,1024);

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

Link to comment
Share on other sites

I decided to give this contrib a whirl on my test store and ran into a small problem. When I get to the step of enabling the new module in the admin console, most of the labels for the fields are missing. I see the labels for the first 2 or 3 fields up to where it asks which currency I want to accept but for the rest of the box all I see are the fields with no labels.

 

which file would cause this? is it the actual paypal.php file located in the payment folder?

 

FWIW, I had .971 installed previous to this which I removed.

 

Thanks for the help....

 

ROdney

 

B)

Link to comment
Share on other sites

forget it :rolleyes: removed/reinstalled solved the problem. I think because I had the older paypalipn file still in the folder caused it to toss its cookies...

 

on to the next step!

 

B)

Link to comment
Share on other sites

I'm trying to install this contribution with the STS templates system and keep getting this error:

Fatal error: Call to a member function on a non-object in /home/******/public_html/includes/sts_display_output.php on line 155

This when checkout_process.php is called.

 

I'm really stuck on this, any help would be great.

 

Thanks

Link to comment
Share on other sites

could someone tell me why my Saskatchewan tax is not being carried over to the paypal sign in page when you check out of my store? The subtotal and shipping are there, but no tax? I'm using paypal ipn 1.7 Other wise everything works great, but I really need this tax to carry over!

 

 

if you want to see it for yourself

My Store

Edited by Kristine
Link to comment
Share on other sites

Mark, dunno much about STS, if you post that line that the error is occurring might help.

 

Kristine, I think this is something to do with how your stores tax zones are configured.

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

Link to comment
Share on other sites

Try this, open up catalog/includes/modules/payment/paypal/processing.tpl.php look at the last line where it says

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

and change to

<?php
// close session (store variables)
 tep_session_close();

 if (STORE_PAGE_PARSE_TIME == 'true') {
   $time_start = explode(' ', PAGE_PARSE_START_TIME);
   $time_end = explode(' ', microtime());
   $parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
   error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv('REQUEST_URI') . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);

   if (DISPLAY_PAGE_PARSE_TIME == 'true') {
     echo '<span class="smallText">Parse Time: ' . $parse_time . 's</span>';
   }
 }

 if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) {
   if ( (PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4') ) {
     tep_gzip_output(GZIP_LEVEL);
   }
 }
?>

Basically the above is the original osCommerce application_bottom.php file

 

Or if you want to start customizing that page you can start putting back in the usual stuff and not use the above, but remember here the only thing the customer should want to do is checkout.

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

Link to comment
Share on other sites

I wondered if it was because PayPal only allows for non-us tax to be by country, not province?

But shouldn't the all the payment info get carried over?

I have it set to itemized cart, maybe I should try the other setting?

Link to comment
Share on other sites

ok, I switeched over to Aggregate mode and it doensn't give details of the tax but it is added to the subtotal and the total price is correct. :) I wish I would have thought of that 3 days ago!!!

Link to comment
Share on other sites

OMG! I'm a complete idiot!!!!!!

I switched back to itemized mode and it's working, probably always was too :(

Apparently I go brain dead after clicking continue! LOL

It's included in the subtal price, just not listed as tax. OIY! I think I've been at this wayyy too long, I need a holiday! Except I have a hard time staying away from it :) LOL

Link to comment
Share on other sites

Hi Greg,

 

it dont work with this lines....

 

I have the same Problem with sts_display_output.......

 

I had copy the body from processing.tpl.php in a original file e.g. conditions.php with sts_display_output preferences, but it also don't work :angry:

 

And now I'm helpless, no more ideas..... waiting for the perfect posting here ;-)

 

Regards from Germany

Regards from Germany...

Link to comment
Share on other sites

Hi Greg,

 

it dont work with this lines....

 

I have the same Problem with sts_display_output.......

 

I had copy the body from processing.tpl.php in a original file e.g. conditions.php with sts_display_output preferences, but it also don't work :angry:

 

And now I'm helpless, no more ideas..... waiting for the perfect posting here ;-)

 

Regards from Germany

Try posting on the STS help pages, since this is more of a sts issue than a paypal issue. Hopefully someone over there could help you as they have probably installed paypal ipn.

Link to comment
Share on other sites

If I copy it into a original file from the sts-contrib I get the following message:

 

Fatal error: Cannot redeclare tep_db_connect() in /var/www/web6/html/includes/functions/database.php on line 13

 

What can I do?

 

This Message, I think, creates the header.php or application_top.php, which is connect to the database.....

 

Regards....

Regards from Germany...

Link to comment
Share on other sites

Hi talon,

 

thats not right, the Problem is, that the processing.tpl.php file and the application_top.php file from Greg not includes the sts-parameters, so it dont work.

 

Sorry for my little bit English, I'm learning ;-)

Regards from Germany...

Link to comment
Share on other sites

processing.tpl.php uses the main application_top.php, the one in this contrib is for non-gui and not used by processing.tpl.php

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

Link to comment
Share on other sites

Hi Greg,

 

that's fine, and header.php and footer.php?

 

This two files includes the sts_capture parameters....!!!

 

Can I reguire this two files in processing.tpl.php?

 

:rolleyes:

Regards from Germany...

Link to comment
Share on other sites

Open up catalog/includes/modules/payment/paypal/checkout_process.php look at the last line where it says

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

and change to

<?php
// close session (store variables)
 tep_session_close();

 if (STORE_PAGE_PARSE_TIME == 'true') {
   $time_start = explode(' ', PAGE_PARSE_START_TIME);
   $time_end = explode(' ', microtime());
   $parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
   error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv('REQUEST_URI') . ' (' . $parse_time . 's)' . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);

   if (DISPLAY_PAGE_PARSE_TIME == 'true') {
     echo '<span class="smallText">Parse Time: ' . $parse_time . 's</span>';
   }
 }

 if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) {
   if ( (PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4') ) {
     tep_gzip_output(GZIP_LEVEL);
   }
 }
?>

Exactly the same code as Greg. Just put in a different place.

Works fine now.

 

Thanks for all the help

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...