Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - Devosc

Recommended Posts

G`day,

 

i installed 2.7 today, works great so far but there are 3 things:

 

the ipn test comes every time back with no valid ID. i double checked the id and the fields 10 more then times.

 

also the date in the admin ...orders.php section only shows Date:

. , <---- Is there something wrong with the date format ? or language in german ?

Time:

13:03:55 PDT

Status:

Pending

Pending Reason:

echeck

 

 

also a got one porb greg or druide ?

 

how can i realise that the stock will automaticaly reduced after the customer visit the payment modul via paypal ?

 

this problem i got since 2.6 with older versions 2.3 or 2.4 all works fine.

 

any ideas ?

 

regards joerg

Share this post


Link to post
Share on other sites
also the date in the admin ...orders.php section only shows Date:

. , <---- Is there something wrong with the date format ? or language in german ?

Time:

13:03:55 PDT

Status:

Pending

Pending Reason:

echeck

Hi Joerg,

 

Did you perform the edits for admin/orders.php? the above if occuring directly in admin/orders.php should not be there as per the TxnLogs screen shot in the docs.

 

Older IPNs, assuming that the upgrade sql script was used, probably won't show the date properly because there was a problem before, due to PayPal changing the format of the date, I say this, because their Integration manual does not show any leading zeros for the day field.

 

Out of interest you use the upgrade sql script or started a fresh?

 

In regard to stock update this should happen once an IPN with a 'Completed' payment status has been received. You should notice this when making a test purchase for example, and have 'subtract stock' enabled in your osC->Configuration->Stock.


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

Share this post


Link to post
Share on other sites

Hi Greg, i did a full newinstall in clude a fresh sql .

 

substrackt stock is enabled and works great with invoice, and inadvanced payment.

 

i realy on my end and have no further ideas what could went wrong with paypal and the stock update.

 

with the new version everything works great accept the dateformat and the stock.

 

i did the ipn test with completed, but the stock is still there as it was. i also did a live payment via ,y brothers account, but the stock is the same.

Share this post


Link to post
Share on other sites

Hi Joerg,

 

Ok I found the problem, in v2.6 I made a change based on someones comment/suggestion in the forum and didn't check it out properly:

 

In catalog/includes/modules/payment/paypal/classes/osC/Order.class.php fin line 91

and change

tep_not_null($stock_values['products_attributes_filename'])
To
(!$stock_values['products_attributes_filename'])

Thanks, for persisting.


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

Share this post


Link to post
Share on other sites

hi greg i did the change to :

if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename']))) {

 

and i did a real paypal transaction, but the stock i still the same.

Share this post


Link to post
Share on other sites

I didn't specify correctly, change your above to

if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {

There was an extra bracket.


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

Share this post


Link to post
Share on other sites

have a look at your debug email and post the payment_date here.

 

Is your stock now substracting?


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

Share this post


Link to post
Share on other sites

Download v2.7a, delete the paypal directory and upload the one from v2.7a.

 

Still need to see what your payment_date is from the debug email.


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

Share this post


Link to post
Share on other sites

hm did a delete and copy everything but now:

 

Warning: main(/home/www/shop/includes/modules/payment/paypal/admin/TransactionSummaryLogs.inc.php) [function.main]: failed to create stream: No such file or directory in /home/www/shop/admin/orders.php on line 243

 

Warning: main() [function.main]: Failed opening '/home/www/shop/includes/modules/payment/paypal/admin/TransactionSummaryLogs.inc.php' for inclusion (include_path='.:/usr/share/php') in /home/www/shop/admin/orders.php on

Share this post


Link to post
Share on other sites

the most of the commpressed files are bad some information of files are missing or corrupted. is there a way to put them as a zip file on the server. i got decompress tools but maybe the tar is the prob ?

Share this post


Link to post
Share on other sites

Was there an error during upload, can you verify that the file was there?

 

In regard to the date problem replace the following functions in paypal/classes/IPN.class.php with the ones below:

  function datetime_to_sql_format($paypalDateTime) {
   $months = array('Jan' => '01', 'Feb' => '02', 'Mar' => '03', 'Apr' => '04', 'May' => '05',  'Jun' => '06',  'Jul' => '07', 'Aug' => '08', 'Sep' => '09', 'Oct' => '10', 'Nov' => '11', 'Dec' => '12');
   $array = explode(" ",$paypalDateTime);
   $time = explode(":",$array[0]);
   $hour = $time[0];$minute = $time[1];$second = $time[2];
   $month = $months[$array[1]];
   $day = preg_replace("/,/" , '' , $array[2]);
   $year = $array[3];
   return ($year . "-" . $month . "-" . $day . " " . $hour . ":" . $minute . ":" . $second);
 }

 function paymentTimeZone($paypalDateTime) {
   $array = explode(" ",$paypalDateTime);
   return $array[4];
 }

 

There is a zip version of v2.7a but it doesn't contain the MS2-2.2 directory which you don't really need.

Edited by gregbaboolal

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

Share this post


Link to post
Share on other sites

You will also need to perform the following mysql alteration so that the timezone is stored correctly:

 

ALTER TABLE `paypal` CHANGE `payment_time_zone` `payment_time_zone` CHAR( 4 ) NOT NULL

 

I downloaded both the zip and tar.gz archives and they looked ok, but bear in mind that catalog/admin is not the same as when saying paypal/admin, the later is really catalog/includes/modules/payment/paypal/admin.


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

Share this post


Link to post
Share on other sites

hi greg the zip works fine. but the date prob still exists (i change you values).

 

the prob in the tar file was in catalog/includes/modules/payment/paypal/admin ... in the language files and under classes.

Share this post


Link to post
Share on other sites
You will also need to perform the following mysql alteration so that the timezone is stored correctly:

 

ALTER TABLE `paypal` CHANGE `payment_time_zone` `payment_time_zone` CHAR( 4 ) NOT NULL

 

I downloaded both the zip and tar.gz archives and they looked ok, but bear in mind that catalog/admin is not the same as when saying paypal/admin, the later is really catalog/includes/modules/payment/paypal/admin.

i did that also but date isn't shown

Share this post


Link to post
Share on other sites

The two functions provided above are to 'replace' the two functions already in IPN.class.php.

 

If will help, in paypal.application_top.inc.php (near the top) uncomment the first error_reporting line and comment out the one below that one. The try out the IPN Test Panel this will should show if any fatal errors are happening.


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

Share this post


Link to post
Share on other sites

gets better, when i click at the AKTIOM bottom (in the Orders.php -Admin) then the stock is reduced. normaly i want that the stock will be reduced directly when the xutomer gets to the paypal website. is there any way greg or should this the normal way ? some of our products are only single pruducts with q qty of 1.

 

the date prob is still there

Share this post


Link to post
Share on other sites

I know that the answer has been provided somewhere in the last 70 pages, but I'd truly appreciate some help right now.

 

When a client purchases something, uses a gift certificate & chooses paypal as a payment method, it doesn't recognize the payment amount & puts a negative charge in the paypal page.

 

Can someone direct me to the right area to get this fixed?

 

PLEASE HELP! LOOSING SALES!!!!


Joel Gallant

Share this post


Link to post
Share on other sites
I know that the answer has been provided somewhere in the last 70 pages, but I'd truly appreciate some help right now.

 

When a client purchases something, uses a gift certificate & chooses paypal as a payment method, it doesn't recognize the payment amount & puts a negative charge in the paypal page.

 

Can someone direct me to the right area to get this fixed?

 

PLEASE HELP! LOOSING SALES!!!!

why dont you turn off the usage of GV in paypal for the moment and send your customers an email about it.

Safe is always the best way


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

Ok, not 100% sure where you are talking about? Where would I look to turn that off? Or do you mean to turn off the paypal contribution totally?

 

I know that does make sense... Thanks for the advise. Anyone else have a suggestion as well?


Joel Gallant

Share this post


Link to post
Share on other sites
Ok, not 100% sure where you are talking about? Where would I look to turn that off? Or do you mean to turn off the paypal contribution totally?

 

I know that does make sense... Thanks for the advise. Anyone else have a suggestion as well?

:( sorry my brain was messed up, i was thinking of an option in a different module (Global Quantity Module).

 

If you can do some PHP coding i am sure you can fit it in....

 

I am VERY sorry, i should do like i normally do , first verify my answer before i hit the Add Reply button.


Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Share this post


Link to post
Share on other sites

Hi Greg thx a lot.

 

i tested the whole paypal thing this morning include downloads. it works fine now the stock will be reduced and the date also works fine now.

 

i did a couple of real transaction to be sure that everything works correctly.

 

i did a little donation via paypal

 

regards joerg

Share this post


Link to post
Share on other sites

Hi,

I'm hoping somewhere here might be able to point me in the right direction for a general OScommerce question. I apologize if this is bad form to ask a non-contribution related question in this thread, but people here seem to be much more responsive.

 

My shop sells one-of-a-kind items, so I want to prevent customers from adding multiple quantities of the same item into their shopping cart. I realize that the oscommerce admin tool will allow me to not let a checkout complete if I don't have the specified quantity on hand, but I don't want the customer to have to deal with the "sorry, this item is sold out" routine of having to modify the quantity levels in their cart. My philosophy being that the customer's experience should be as user-friendly as possible, and that the store owner should attempt to account for as many scenarios as possible.

 

So basically, the code I need help writing is:

If the customer has a particular item in their shopping cart, and they click on the same item again, the item description page should <I>not</I> have the "add to cart" button displayed, and possibly a message saying "Sorry, but you already have this item in your cart".

 

thanks for your help.

pulp

Share this post


Link to post
Share on other sites
Ok, not 100% sure where you are talking about?  Where would I look to turn that off? Or do you mean to turn off the paypal contribution totally?

 

I know that does make sense... Thanks for the advise. Anyone else have a suggestion as well?

:( sorry my brain was messed up, i was thinking of an option in a different module (Global Quantity Module).

 

If you can do some PHP coding i am sure you can fit it in....

 

I am VERY sorry, i should do like i normally do , first verify my answer before i hit the Add Reply button.

Ok, so, coding would be the fix for that....

 

Any idea what code I would need to fix. I have no idea what to write...


Joel Gallant

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  

×