Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal IPN?


Paul_C

Recommended Posts

Hi Joe

 

I tested the variable &email= on the link to paypal and even though it is not documented, the email address I added to it showed up in the customer email field.

 

You are right!

It is working

I have added it to the contrib... will be released with the new version.

 

You just have to make sure that the last line in /catalog/checkout_paypalipn.php looks like this:

 

tep_redirect("https://secure.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" . MODULE_PAYMENT_PAYPALIPN_ID . "&item_name=" . STORE_NAME . "&item_number=" . $insert_id . "&amount=" . number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->currencies['USD']['value'], 2) . "&shipping=" . number_format($order->info['shipping_cost'] * $currencies->get_value('USD'), 2) . "&return=" . tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL') . "&cancel_return=" . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . "&first_name=" . $order->customer['firstname'] . "&last_name=" . $order->customer['lastname'] . "&address1=" . $order->customer['street_address'] . "&city=" . $order->customer['city'] . "&state=" . $order->customer['state'] . "&zip=" . $order->customer['postcode'] . "&email=" . $order->customer['email_address']);

 

The email part is in the end . "&email=" . $order->customer['email_address'].

 

Thanks!

Link to comment
Share on other sites

  • Replies 175
  • Created
  • Last Reply

Top Posters In This Topic

Just got everything to work. The problem I had with the IPN was my own fault -- I had the app on a protected drive.

 

Question to you Pablo, and Maybe to you too Chris, I looked through the code, but didn't see where the data on paypalipn_txn and paypalipn_temp_data gets purged from the system. Is the maintenance manual, or did I miss something?

 

Thanks for all your help!

 

Joe.

Link to comment
Share on other sites

Question to you Pablo, and Maybe to you too Chris, I looked through the code, but didn't see where the data on paypalipn_txn and paypalipn_temp_data gets purged from the system. Is the maintenance manual, or did I miss something?

 

Hi Joe

 

I dont understand what you mean with "gets purged".

 

paypalipn_txn is writed when a new transaction is received from PayPal

It is also readed from the Admin, in the PayPal IPN->Transactions

 

paypalipn_temp_data is writed by checkout_paypalipn.php.

There the module stores temp data for the email to be sent when the order change his status to PENDING (that is done by paypal_notify.php).

 

best regards

Link to comment
Share on other sites

I dont understand what you mean with "gets purged".  

 

Hi Pablo,

 

Sorry for the terminology! I meant when does the transaction get deleted from the database? If we keep adding new records to the database, without deleting old records, then the database will eventually get corrupted. I was just asking if we need to manually delete the records off the database, or did you design it as part of the code?

 

Thanks!

 

Joe.

Link to comment
Share on other sites

That's a pretty good point.

 

I've been manually deleting the 'paypal processing' status orders manually.

 

It would be nice if the program could delete orders that didnt get notified by IPN and updated to 'Processed'

 

Could we spinn off a process in the background that slept for a few minutes, and then checked the status of the orders, and if it is still 'paypal processing' (meaning that IPN did not send a response) then that order would be deleted?

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

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Sorry for the terminology! I meant when does the transaction get deleted from the database?

If we keep adding new records to the database, without deleting old records, then the database will eventually get corrupted. I was just asking if we need to manually delete the records off the database, or did you design it as part of the code?

 

In really, I never though in making anything to delete registered transactions.

The idea is that the system register ALL transactions (VERIFIED and INVALID), and you have the chance of delete them clicking on the DELETE button.

 

Best regards

Link to comment
Share on other sites

Pablo,

 

That is what I was missing. The delete function in the Admin. That makes sense. I will probably come up with some tool later that will delete entries that are over a certain length old. But, I have a LOT of other things I need to do first!

 

Thanks again!

 

Joe

Link to comment
Share on other sites

Hi Chris

 

I've been manually deleting the 'paypal processing' status orders manually.

 

It would be nice if the program could delete orders that didnt get notified by IPN and updated to 'Processed'

 

Could we spinn off a process in the background that slept for a few minutes, and then checked the  status of the orders, and if it is still 'paypal processing' (meaning that IPN did not send a response) then that order would be deleted?

 

That is something that I should resolve.

 

It should be like this:

 

1) If paypal_notify.php dont ever receive any response from PayPal, the order status should change to 'paypal_unproccessed' after some time (a few hours after the order was placed).

2) If paypal_notify receive an INVALID response from PayPal, the order_status should change to 'paypal_invalid'.

3) If paypal_notify receive an CONFIRMED response and Payment Status=='Pending', the order status should still appear as 'paypal_processing' (the module is already working this way)

4) If paypal_notify receive an CONFIRMED response and Payment Status=='Pending', the order status should be changed to 'Pending(DEFAULT_ORDERS_STATUS_ID)' (the module is already working this way)

 

Then I should make some check, and delete those 'paypal_unprocessed' and 'paypal_invalid' after some time (configured in the module).

 

I will be working on this next week

Link to comment
Share on other sites

Pablo,

 

I don't want to be a pain but, you might want to use the date and time field on the database and order by date and time in Admin. Right now, the order by clause is by trn_id which in my case didn't come out in a meaningful order.

 

Please let me know if you want assistance with this.

 

Thanks...

 

Joe.

Link to comment
Share on other sites

Your work will be greatly appreciated by many.  Have you gotten your paypal account straightened out yet for donations?

 

No, It seems my PayPal account will not be able to receive funds/donations for many time. That feature does not work for users that live in Argentina :(

 

I don't want to be a pain but, you might want to use the date and time field on the database and order by date and time in Admin. Right now, the order by clause is by trn_id which in my case didn't come out in a meaningful order.  

 

Please let me know if you want assistance with this.

 

You are right Joe

 

I dont know why have I make it order by trn_id... I will fix it in next release together with other things (cURL related).

 

Thanks!

 

Best regards

Link to comment
Share on other sites

Hola Pablo,

Una pregunta... si quieres incorporar Billpoint como opcion en el Checkout , tienes alguna sugerencia?

 

Hola Virginia

 

La verdad que nunca probe Billpoint, y de hecho no lo conocia :)

 

Si trabaja igual que PayPal, se podria hacer un modulo similiar al modulo que viene en osCommerce, pero que envie los datos a BillPoint, pero habria que averiguar un poco mas.

 

Lo que seguramente no deben tener, es una funcionalidad como la de PayPal IPN, pero igualmente se podria hacer un modulo.

 

Cuando termine con el modulo de PayPal intentare hacer algo

 

Saludos

Link to comment
Share on other sites

Anyone installed this mod and got it working on an older 2.2 of oscommerce.....like a february release?

 

Hi crshNbrn

 

I dont think it works on an February release

 

One problem is that your version dont have the Breadcrumb. Anyway you can make it work modifying the part that makes use of the breadcrumb.

 

The real problem, is that maybe your version dont have the order class.

 

Best regards

Link to comment
Share on other sites

Also if you would like trying with C2IT (they don't charge to pay or sell with this service). I'm just happy with an option in payments and a link to get them there for now (or anyone out there who has done something like that) or that I can copy... thanks!

 

Hola Pablo,

Una pregunta... si quieres incorporar Billpoint como opcion en el Checkout , tienes alguna sugerencia?

 

Hola Virginia

 

La verdad que nunca probe Billpoint, y de hecho no lo conocia :)

 

Si trabaja igual que PayPal, se podria hacer un modulo similiar al modulo que viene en osCommerce, pero que envie los datos a BillPoint, pero habria que averiguar un poco mas.

 

Lo que seguramente no deben tener, es una funcionalidad como la de PayPal IPN, pero igualmente se podria hacer un modulo.

 

Cuando termine con el modulo de PayPal intentare hacer algo

 

Saludos

Link to comment
Share on other sites

I am having problems with the PaypalIPN modules. It seems to work up to the point it tells paypal OK... I get the payment notification, and if you do hit the continue button in PP, it brings to the checkout_success. But I am not getting any of the email notifications that an order has been placed. (neither to the main or extra emails)...

 

A couple of questions for clarification: the change TITLE_HEADER, etc. to $TITLE_ etc. is for the two checkout_success.php only files, correct?

 

Where should I set the paypal IPN URL in the admin? Is it the same as the URL I set at the PayPAl IPN Notification area?

Link to comment
Share on other sites

I am having problems with the PaypalIPN modules. It seems to work up to the point it tells paypal OK... I get the payment notification, and if you do hit the continue button in PP, it brings to the checkout_success. But I am not getting any of the email notifications that an order has been placed. (neither to the main or extra emails)...

 

A couple of questions for clarification: the change TITLE_HEADER, etc. to $TITLE_ etc. is for the two checkout_success.php only files, correct?

 

Where should I set the paypal IPN URL in the admin? Is it the same as the URL I set at the PayPAl IPN Notification area?

 

Thanks for help!

 

Kevin

Link to comment
Share on other sites

Hi Kevin

 

But I am not getting any of the email notifications that an order has been placed. (neither to the main or extra emails)...

1) What status the order has in your Admin->Customers->Orders?

2) If you click on the order (so you see all order details), what do you see on the Notify Customer History?

the change TITLE_HEADER, etc. to $TITLE_ etc. is for the two checkout_success.php only files, correct?

You are supposed to have only one checkout_success.php file :)

Anyway, the answer is YES, the addition of the $ is only for that file.

Where should I set the paypal IPN URL in the admin? Is it the same as the URL I set at the PayPAl IPN Notification area?

Since PayPal IPN v0.90, the PayPal IPN URL is setted from Admin->Modules->Payment->PayPal IPN->Notify URL.

It is autodetected when you install the contrib, but you can anyway check if it is correct.

 

I hope it helps!

 

Best regards

Link to comment
Share on other sites

Hmmm... not sure why my post showed up twice.

 

Anyway, thanks for helping me through this Pablo!

 

1) What status the order has in your Admin->Customers->Orders?

2) If you click on the order (so you see all order details), what do you see on the Notify Customer History?

The order staus show PayPal Processing, and the order details shows no history.

You are supposed to have only one checkout_success.php file

Anyway, the answer is YES, the addition of the $ is only for that file.

I have 2 checkout_success.php files;

catalog/checkout_success.php

catalog/includes/languages/english/checkout_success.php

Wasn't I supposed to add text to each?

 

And lastly,

Since PayPal IPN v0.90, the PayPal IPN URL is setted from Admin->Modules->Payment->PayPal IPN->Notify URL.

It is autodetected when you install the contrib, but you can anyway check if it is correct.

Is the PayPal IPN>Notify URL the same one I should use at the paypal site?

Link to comment
Share on other sites

Hi Kevin

 

The order staus show PayPal Processing, and the order details shows no history

 

Ok

So the payment is NOT being notified to the paypal_notify.php script.

 

Have you made the payment?

 

In Admin->PayPal IPN->Transactions do you have anything?

 

I have 2 checkout_success.php files;

catalog/checkout_success.php

catalog/includes/languages/english/checkout_success.php

Wasn't I supposed to add text to each?

 

Right, you have 2 files, but following the file structure of the PayPal IPN Contrib, you should modify ONLY the first one (/catalog/checkout_success.php).

 

Is the PayPal IPN>Notify URL the same one I should use at the paypal site?

It does not matter if you use the same or not.

If you will receive payments only from your site, that's ok!

 

Best regards

Link to comment
Share on other sites

Hi Pablo,

 

In Admin->PayPal IPN->Transactions do you have anything?

This might be part of the problem. I don't see any PayPal IPN> Transactions. All I see is under the Orders a "PayPal Processing". It does list the new paypal orders so it is registering them here at least.

 

I am not sure if it is clearing out the cart either. If you sign back in I think you will see your shopping cart still has the item. (although I deleted the order so maybe not). I assume that if it did finalize the sale all the notifications would be a part of this.

 

Thanks,

 

Kevin

Link to comment
Share on other sites

After much searching I finally found the IPN Transactions box.

I was looking at the large blue admin box not on the left. :oops:

 

I see that the IPN Result is INVALID, however payment status is Completed, which would explain that we got this far but no further. The next question I guess is what's next!

 

Also, the Num_Cart_Items field says 0... is this PayPal returning this or is it OSC checking that the cart has been emptied?

 

Thanks again!

Link to comment
Share on other sites

Pablo,

 

I have searched and gone over this module as best I can. I still can not get it to work. The IPN Result is INVALID yet Payment Status is COMPLETE. The text if you do hit the continue gives a "Your payment failed" notice, which is actually untrue. The payment does work, it is the checkout that failed.

 

I have noticed a few things that may affect this; Invoice field is blank & Num Cart Items is "0"... Could these things have anything to do with the breakdown?

Also, is there a way to add the no_shipping=1. I am pretty sure I could add this, but do you know if it is not an acceptable field? I don't want PayPal to ask for shipping when I already have in the checkout process.

 

3:00am and I am giving up!

Link to comment
Share on other sites

Pablo ... firstly i have to say well done .....this mod is excellent.

 

I am wondering if you have any details on the new multi currency feature that PayPal is about to implement?

 

I would assume that when it begins the mod will need to be edited to suit.

 

do you have any details?

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