Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - Devosc

Recommended Posts

Thanks for the tip.

 

All is working well now I think except for one thing. Having completed my transaction with PayPal and clicked to return to the shopping cart I got the following error:

 

1054 - Unknown column 'payment_id' in 'field list'

 

select payment_id from orders where orders_id ='1'

 

[TEP STOP]

 

This was back at my site at the url: http://www.creativeadmintechnology.net/cat...out_success.php?

 

And when I go into PayPal IPN in OSC Admin there's nothing there, and in Orders I get this:

 

1054 - Unknown column 'o.payment_id' in 'on clause'

 

select p.payment_status from paypal p left join orders o on p.paypal_id = o.payment_id where o.orders_id ='1'

 

[TEP STOP]

 

 

Any thoughts?

 

 

My last post mentions ccgv and this should be sufficient enought to get the voucher into the queue ( ? ) or atleast applies the credit....

The old paypal file in includes/modules/payment cannot have a '.php' extension, rename it to '.php.bak'

Share this post


Link to post
Share on other sites

Hi devosc,

Thanks for your help. :)

 

Something is happening such that the $language variable is not populating the language column in the orders_session_info table during the customers checkout.... have a look to see that this column is being correctly populated (i.e. got something in it).
.

 

I found that there are missing $langauge variable on line 37 in AcceptOrder.inc.php file. After corrected is OK :P

 

 $PayPal_osC_Order->setCheckoutProcessLanguageFile(DIR_FS_CATALOG_LANGUAGES . $PayPal_osC_Order->language . $language .'/' . 'checkout_process.php'); // line 37

 

 

My last post mentions ccgv and this should be sufficient enought to get the voucher into the queue ( ? ) or atleast applies the credit....

Sorry devosc, I cannot get your meaning about it.

But more information that if i removed the PayPal payment module and only available paid for cash on delivery, the GV release queue is exist. Otherwise, the release queue cound not be found if i turn on the PayPal module for payment.

Is any message flag or indicator waiting from Paypal IPN side? :(

 

Anita.


Welcome to vist my Site:

Anita.

Share this post


Link to post
Share on other sites

Sinc we are on a language topic .. I am using Paypal in switzerland, and offer english or french langauges on my site.

However when paying with paypal my customer always end up on a paypal paying screen in German!!

Is there any way around this ?

I have changed my setting on my paypal account so i can navigate in french, I can also do this to change it all to english but this makes no difference during checkout process :(

Any help please ??

Share this post


Link to post
Share on other sites

hello Gregory thanks for quick and informative answers and this seems to be just what i need unfortunatly i have two problens for now

1-i am using live with real payment and i am not getting any ipn but this might be from paypal side since i also tested the other version and still no ipn so i am going to wait

2-when i do this

[3] for ccgv in:

catalog/includes/modules/payment/paypal/catalog/checkout_process.inc.php

line 207 remove the comments '//' from the beginning of the line this will apply the credit

i get this

Fatal error: Call to a member function on a non-object in /home/pizzainn/public_html/includes/modules/payment/paypal/catalog/checkout_process.inc.php on line 207

Share this post


Link to post
Share on other sites

Did you run the database sql script... this needs to be confirmed, they're are some table and thre alterations invloved.

You should look more into the $language problem, $PayPal_osC->language should have the value of the customer's language they used during checkout, whereas you are using the admin language (and the $PayPal_osC->language var still exists in the code).

 

See below regarding ccgv... thats the most that I can get into regarding ccgv at this time....

Currently the contribution will specify the language flow that PayPal should use based upon the iso_code_2 in modules/paypal.php line 339, you want to chack and verify the iso_code_2 value being sent (view the source of the checkout splash screen - disable javascript for this).

You said you had the CCGV contribution installed ? admittedly I personally haven't tested both together (well I have but I didn't try with any vouchers etc...) but logically it should work. Anyhow if you change (approx line 203 of catalog/includes/modules/payment/paypal/catalog/checkout_process.inc.php):

//$order_total_modules->apply_credit();

To:

 if(is_callable(array($order_total_modules, 'apply_credit')))
   $order_total_modules->apply_credit();

This should work... however if you got an error previously then the above will never actually execute.... but as said that is what is required in order to apply (deduct) the customer's existing credit....

 

You don't have to wait for PayPal to verify that the PayPal Shopping Cart IPN system works, there is a link in the admin/paypal configuration section for the IPN Test Panel. This provides a GUI interface to the whole process... search the thread for more info if neccessary.


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

Share this post


Link to post
Share on other sites
Did you run the database sql script... this needs to be confirmed, they're are some table and thre alterations invloved.

 

My stupidity even astounds me sometimes. I actually woke up at 6:30am this morning and the very first thing I thought was "Oh my God I didn't run the sql script again!" Of course, it works fine now. Somehow I think I'm not the only OSC 'developer' that eats, sleeps and drinks OSC until it works as they want.

 

If you don't mind I do have three further questions:

 

1) When I move forwards through the cart (as a customer) to the payment information page (checkout_payment.php) I get the following text:

 

Payment Method

 

This is currently the only payment method available to use on this order.

PayPal

MODULE_PAYMENT_PAYPAL_CC_TEXT

MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION MODULE_PAYMENT_PAYPAL_CC_URL_TEXT

 

and the two 'module_payment...' lines are repeated on the subsequent transfer page before getting to PayPal.

 

2) I have to enter a contact telephone number on the PayPal payment page even though I have the option set to 'off' (as receommended) in the PayPal options.

 

3) I still have to click on 'Return to Merchant' in the PayPal final page even though I have 'Auto Return' selected.

 

Really appreciate your help.

 

Thanks.

Share this post


Link to post
Share on other sites

Thanx for the answer .. I looked at the code and it works properly. For billing in Switzerland is send CH to paypal .. but paypal put this in German :( I will mod the code a little to send the (int)language in use by the customer to avoid any confusion.

I guess this is only annoying for a few countries who use more han one langauge, like Switzerland or Belgium. Might also be a pain for customer living in a country as an expat.

Woudl there be a way to have this become an admin option (ie Use billing country language or use navigation language?)

Share this post


Link to post
Share on other sites

Actuially, i just tried this out and it doesnt work, as soon as the customer select Switzerland back onto the paypal side for checkout, it reverts to German .. I will contact them and see if they can change their gateway to give the language option there ...a bit like they do if you have an account with them

Share this post


Link to post
Share on other sites
For [1] it's because the language files where not uploaded, it may be best to verify the whole install process again (45 mins is avg for fresh install). [2] The option in tha admin is in regarding to either shipping or notes, not telephone. [3] To be automatically redirected back to the site you need to enable this feature in you paypal account profile.... see the FAQs....
From looking at the latest integration manual available from PayPal, it seems US English, UK English, German and Japanese are currently the only paypal-checkout-flow languages available.

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

Share this post


Link to post
Share on other sites

Works in french also, I tested this with a fake french customer .. i sent an email to paypal asking them if they could put a drop down for language on their checkout page so it pick the country language per default but the user can thy choose another preferred language ..wioll let you know when I get an answer.

Share this post


Link to post
Share on other sites
For [1] it's because the language files where not uploaded, it may be best to verify the whole install process again (45 mins is avg for fresh install). [2] The option in tha admin is in regarding to either shipping or notes, not telephone. [3] To be automatically redirected back to the site you need to enable this feature in you paypal account profile.... see the FAQs....

 

Thanks. I'm convinced I uploaded everything but I unless I do it all again I guess I'll never be sure.

 

May be a daft question: As the merchant should I (can I) receive an email saying an order has been placed?

Share this post


Link to post
Share on other sites

hello Gregory

i have come across a problem it seems that i don't recive the ipns at all and also when i do a test i am not getting anything also the code for ccgv

$order_total_modules->apply_credit();
does work in checkout_process.php but not with paypal so maybe the correct file is not included.

i don't understand why this code wouldn't work?!!!

Share this post


Link to post
Share on other sites

Could use some help here: paypal mod seems to be working great except for one thing I can't figure out: the checkout_success.php page.

 

What I get is this:

Your order has been successfully processed! You will be receiving emails shortly detailing your purchase and the delivery of your products.

 

Please notify me of updates to the products I have selected below:

 

Thanks for shopping with us online!

Notice that there are no products listed; for some reason this page isn't getting the right setup for variables required to locate the products ordered. In my case this is doubly problematic because this page is where I create and email the customer's serial #s ... but since the page doesn't know what is ordered this doesn't happen.

 

Any clues as to what could be causing this?

 

Thanks!

Share this post


Link to post
Share on other sites

Hi Greg

 

This mod installed very smoothly (apart from the alter table instructions in the sql file, but it would be hell if you were completely perfect!)

 

I have scanned this part of the forum and notice folks are not getting their ipns. I am also suffering this. Is it because I am using the sandbox? If I go live will I get them?

 

I installed your new v3, because I was no longer getting my ipns for some reason on the v2.3 which HAD been working perfectly. Is there any list of fixes that I can follow up for this lack of IPN's. I know that Paypal have been having problems, but i have tried again today and a couple of hours later still nothing.

 

Have pm'd you with this as well

cheers

Kim

Share this post


Link to post
Share on other sites

Hi Kim,

I just tried a quick transaction via paypal's sandbox and received the IPN immediately etc... I suppose that you might try a $0.01 via the live paypal site.... since you've just upgraded, it might be an idea to try a test via the IPN Test Panel from the admin/modules/payment/paypal section just to make sure that an IPN received will process correctly (i.e. without errors etc).


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

Share this post


Link to post
Share on other sites

HI,

 

Using PHP5, we are currently getting this error

 

' Fatal error: Cannot re-assign $this in /home/dave/public_html/shop/includes/modules/payment/paypal.php on line 25 '

 

Is there any fix for this?

Share this post


Link to post
Share on other sites

I have the 3.0a version of this IPN and have the snapshot 3-9-2005 installed. In the application_top.php file there is no $cart like in the install file. Didn't know if it was still possible to use or not. I tried to use the original 2.2 and had a lot of problems with my php5. Any help would be nice.

Share this post


Link to post
Share on other sites

Although it is possible (try and track the differences in regard to the original cart in MS2 to MS3 [sessions]), it wouldn't be possible to provide support here at this time, especially as the MS3 code base has actually changed quite a bit from the version you downloaded...


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

Share this post


Link to post
Share on other sites

Hello,

 

Just completed the IPN install and everything worked great. One problem is after paypal confirms the order if I do not click on the "return to Merchant" button the item will not be removed from the customers shopping cart.

 

Also, if I click on the "return to merchant" and my session timed out I will be sent back to my shop at the login screen. After logging in the shopping cart still shows the item. By the way the customers order history shows the successful order but cart is not subtracted.

 

Any help?

Share this post


Link to post
Share on other sites

I am still struggling to get this to work on our site. I just ran a test transaction, actually paid from one account to another, received both emails from pay pal saying the payment was successful, received three debug emails - here is the last one.

 

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

PayPal_Shopping_Cart_IPN Debug Email Notification

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

mc_gross=6.00

invoice=10

item_number1=

payer_id=SSUWYZY59PRD2

tax=0.00

payment_date=11:43:09 Mar 13, 2005 PST

payment_status=Completed

mc_tax1=0.00

mc_shipping=0.00

mc_handling=4.00

first_name=Samantha

mc_fee=0.54

notify_version=1.6

custom=e2a9557370967b017732dfae3e9d7d2a

payer_status=verified

business=orders@australian-######.com

num_cart_items=1

mc_handling1=0.00

payer_email=webmaster@#########.com

verify_sign=Afi.IeKPWksMWzkE-pOvdSRST1pvAgwYSlUUd5vJl04XqA2PLuS47vAh

mc_shipping1=0.00

tax1=0.00

txn_id=3RF17425CD1802220

payment_type=instant

payer_business_name=Samantha McIvor

last_name=McIvor

item_name1=Aboriginal Lawman Postcard

receiver_email=orders@australian-#######.com

payment_fee=

quantity1=1

receiver_id=HDTTBMRNJUGPN

txn_type=cart

mc_currency=AUD

mc_gross_1=2.00

payment_gross=

 

 

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

PayPal Response

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

VERIFIED

 

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

Connection Type

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

curl:  transport: ssl:// domain: www.paypal.com port: 443

 

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

Email and Business ID config

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

Store Configuration Settings

Primary PayPal Email Address: orders@australian-######.com.au

Business ID: orders@australian-########.com

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

PayPal Configuration Settings

Primary PayPal Email Address: orders@australian-#######.com

Business ID: orders@australian-#######.com

 

PayPal Transaction ID: 3RF17425CD1802220

 

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

Attention!

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

This is email has NOT been sent by PayPal.

 

You have received this email via the osCommerce PayPal_Shopping_Cart_IPN Contribution

 

To discontinue receiving this notice disable 'Debug Email Notifications' in your osCommerce PayPal configuration panel.

 

Yet the status did not change and the order process emails were not sent out (my biggest problem) - as it's clear payment is being received, how do I get it to change status and send out the order process emails?

Share this post


Link to post
Share on other sites

Try setting the module into test mode and simmulate your own ipn via the IPN Test Panel. This will verify that the expected IPNs receieved will indeed actually be processed.

 

When the IPN is received the customers basket is automatically reset.

 

There might be a delay before the IPN is acutally received, but if the customer did return to the site (checkout_success.php) then their cart will be reset.

 

The best thing might be to do is to enable Auto-Return in your paypal account profile, this should prevent the flow of the checkout process from timing out etc...


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

Share this post


Link to post
Share on other sites

G'day! I've never been able to get the simulation working (not sure if you remember, it just goes to a dead page), regarding auto return, what URL do I put into auto-return?

 

By the way, I am getting a LOT of debug emails for this transaction, is there anything to be understood from the above?!

Share this post


Link to post
Share on other sites
Try setting the module into test mode and simmulate your own ipn via the IPN Test Panel. This will verify that the expected IPNs receieved will indeed actually be processed.

 

When the IPN is received the customers basket is automatically reset.

 

There might be a delay before the IPN is acutally received, but if the customer did return to the site (checkout_success.php) then their cart will be reset.

 

The best thing might be to do is to enable Auto-Return in your paypal account profile, this should prevent the flow of the checkout process from timing out etc...

 

Thanks for the quick response. I am running in test mode and when and order is successful with paypal the order status changes to verified. But if the customer does not click on return to merchant the shopping cart is not updated...

 

Date Added Customer Notified Status Comments

03/13/2005 12:43:58 Paypal verified. PayPal IPN Verified [Completed (Unverified; $21.84)]

03/13/2005 12:48:52 Preparing [PayPal IPN]

 

 

I have auto return set to checkout_success.php but if the customer is not a paypal user they still need to click on the return to merchant.

 

Thanks again.

Share this post


Link to post
Share on other sites

Oooh, I tried it again and it worked:

 

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

PayPal_Shopping_Cart_IPN Debug Email Notification

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

business=orders@australian-#########.com

receiver_email=orders@australian-########.com.au

verify_sign=PAYPAL_SHOPPING_CART_IPN-TEST_TRANSACTION-00000000000000

payment_date=13:00:26 Mar 13, 2005 MST

digestKey=9649d3edc68b63f177143a965fade074

first_name=John

last_name=Doe

payer_business_name=ACME Inc.

payer_email=root@localhost

payer_id=PAYERID000000

payer_status=verified

invoice=

address_name=John Doe

address_street=1 Way Street

address_city=NeverNever

address_state=CA

address_zip=12345

address_country=United States

address_status=confirmed

payment_type=instant

txn_type=cart

custom=e2a9557370967b017732dfae3e9d7d2a

txn_id=e2a9557370967b017

parent_txn_id=

num_cart_items=1

notify_version=1.6

memo=PAYPAL_SHOPPING_CART_IPN TEST

mc_currency=AUD

mc_gross=6.00

mc_fee=0.01

settle_amount=0.00

settle_currency=

exchange_rate=0.00

payment_status=Completed

pending_reason=

reason_code=

submit=Test IPN

 

 

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

PayPal Response

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

INVALID

 

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

Connection Type

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

curl: transport: ssl:// domain: www.paypal.com port: 443

 

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

Email and Business ID config

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

Store Configuration Settings

Primary PayPal Email Address: orders@australian-#######.com.au

Business ID: orders@australian-########.com

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

PayPal Configuration Settings

Primary PayPal Email Address: orders@australian-######.com.au

Business ID: orders@australian-#######.com

 

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

IPN INSERTED

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

IPN 1 has been inserted

 

I used the successful transaction code to do that with, It sent out the order process email when I ran this test for the earlier transaction. Erm...... what happens now? Don't tell me I need to run a test everytime I have a transaction just to get the emails sent out? LOL

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  

×