Jump to content
Mark Evans

Official PayPal IPN Support Thread

Recommended Posts

Please have a look at the help file which is included in the contribution package - it includes all the info and two suggested fixes. All the best - Terra PS: If you can't find the help file download any package last uploaded by myself as it definitely includes it.

Thanx Terra! I was trying to find a solution in the READ ME! I had overlooked the help folder! I'm on it :)

Share this post


Link to post
Share on other sites

Well Thank to Terra my Order already paid issue is now solved but while returning on the shop I have this

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
(output started at /var/www/web530/html/e-shop/checkout_process.php:2) in /var/www/web530/html/e-shop/includes/functions/sessions.php
on line 97

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/web530/html/e-shop/checkout_process.php:2) in /var/www/web530/html/e-shop/includes/functions/general.php
on line 29

 

I did read what Terra wrote about root and language level and did check this for the

checkout_process.php (roots and language)

paypayl_ipn.php (modules and language)

ipn.php

 

I could only find that the correct files were uploaded at the correct location... :S

any idea where to keep looking?

Edited by Burntheweb

Share this post


Link to post
Share on other sites

okee, I found my mistake.. corrected, now I get the checkout process page.

however I get a error email

 

Subject PayPal IPN Invalid Process

 

 

$_POST:

 

txn_type=web_accept

payment_date=04:46:44 May 06, 2007 PDT

last_name= las name

residence_country=NL

pending_reason=unilateral

item_name=the Gathering webshop

payment_gross=

mc_currency=EUR

payment_type=instant

verify_sign=ABkf-Fki.z9qZvQYNep-9SIEQzAVARfvpw4TD3dvcRHcnxGld1rqnopf

payer_status=unverified

test_ipn=1

tax=0.00

payer_email=email@domain.com

txn_id=0

quantity=1

receiver_email=email@domain.com

first_name=ALex

invoice=G43

payer_id=Z5V2HMPWTLM46

item_number=

payment_status=Pending

shipping=0.00

mc_gross=6.35

custom=2

charset=windows-1252

notify_version=2.1

 

$_GET:

 

the order appears in the admin pannel as preapring Paypal IPN

 

On sandbox.paypal.com I can see the follwoing lines per order

Payment To payment@gathering.nl 6 May 2007 Unclaimed Details Cancel -€24,65 EUR €0,00 EUR

Transfer From Credit Card 6 May 2007 Completed Details €24,65 EUR €0,00 EUR

 

so I guess this is working.. why do I get this email then??

 

Cheers

Share this post


Link to post
Share on other sites

Integrating CCGV and Afiliates into PayPal IPN: Update.

 

OK, I make no representation that this works for everybody and in every circumstances, but it seems to work for me so far. Note: I am still testing, so if you have input in this, go ahead and help us. So.

 

I have made the following changes to incorporate CCGV and Affilitaes in Paypal IPN v. 2.2.

 

1 - In file paypal_ipn.php, i have made the following changes (the file actually is "paypal_ipn.php,v 2.1.0.0 13/01/2007 16:30:28")

 

1.1 - At or around line 205, you will see:

$sql_data_array = array('orders_id' => $insert_id,
								'products_id' => tep_get_prid($order->products[$i]['id']),
								'products_model' => $order->products[$i]['model'],
								'products_name' => $order->products[$i]['name'],
								'products_price' => $order->products[$i]['price'],
								'final_price' => $order->products[$i]['final_price'],
								'products_tax' => $order->products[$i]['tax'],
								'products_quantity' => $order->products[$i]['qty']);

		tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

		$order_products_id = tep_db_insert_id();

 

Right below "$order_products_id = tep_db_insert_id();", insert this:

$order_total_modules->update_credit_account($i);// CCGV

 

1.2 - at or around line 493, you'll find this:

// unregister session variables used during checkout
  tep_session_unregister('sendto');
  tep_session_unregister('billto');
  tep_session_unregister('shipping');
  tep_session_unregister('payment');
  tep_session_unregister('comments');

  tep_session_unregister('cart_PayPal_IPN_ID');

 

Right below "tep_session_unregister('cart_PayPal_IPN_ID');", insert this:

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');// CCGV
$order_total_modules->clear_posts();// CCGV

 

1.3 - at or around line 264, you will find this:

		  tep_session_register('cart_PayPal_IPN_ID');
	  // Terra register globals fix
	  $_SESSION['cart_PayPal_IPN_ID'] = $cartID . '-' . $insert_id;
	}
  }

  return false;
}

 

 

Just above the "return false;", insert this:

 

  // Include OSC-AFFILIATE
 require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');

 

 

2 - Now, in file ipn.php (located deep inside the "ext" directory - it's actually file $Id: paypal_ipn.php,v 2.1.0.0 13/01/2007 16:30:21):

 

2.1 - at or around line 227, you will find this:

// PRODUCT LOOP ENDS HERE

 

right above "// PRODUCT LOOP ENDS HERE", insert the following code:

$order_total_modules->apply_credit();// CCGV

 

That's it, and so far, it works for me. But: Alltogether now: Backup your files!

 

Do I need to say this also? Use at your own risk!

 

And if it does not work for you: Please don't blame me!

Share this post


Link to post
Share on other sites

Can someone please help me with this, before I go right off osCommerce altogether??

 

I am using:

osCommerce 2.2MS2

Paypal IPN v2.2

 

I have been trying to fix this problem for weeks now, and have finally given up. I feel that I just need to tick a box somewhere, but can I find the box...??!??!

 

The problem is thus - I have set up IPN and made a test purchase on the live Paypal server. A few things happened, which I know someone will be able to help me with.

 

1) - When I (as the customer) was taken to Paypal, the order total was set to £0.00, and I had to change it manually. Obviously not good.

2) - the email I (as the customer) received from paypal did not list the items ordered - under "order description" it just gave the name of the website I ordered them from.

3) - the email I (as the site owner) received also didn't list the order details - just gave the site name.

4) - the email I (as the web designer) received was the error message that begins

 

$_POST:

 

mc_gross=1.45

invoice=52

address_status=confirmed

payer_id=5LWZJEN5C2RBS

tax=0.00

 

 

Any help would be VERY much appreciated. I have searched the forums to no avail, particularly for the solution to the order total and order details problems.

 

Thanks

Lonote

Share this post


Link to post
Share on other sites
This error most often occurs when you mix up root & language level files - check your files to make sure that you didn't overwrite your language-level file with the root by mistake. As they have the same filename this can happen very easily. All the best - Terra

 

 

Hi.. I could see how that might happen, but that isn't the case here.. The two similarly named files are very different.. any other suggestions?

 

Thanks

Share this post


Link to post
Share on other sites

I posted a seperate question in general support, but really could use some help.

 

My programmer installed the CCGV yesterday and it seems to be working. However, we did notice today that the ship to info on the invoice and order process email is blank and it is not allowing my table rate shipping to total shipping.

 

Anyone here have any thoughts on how to fix this??

 

I really like this contribution and need to use it, but not if the shipping won't be able to function. Thank you

Share this post


Link to post
Share on other sites

I havent had a chance to read thru all 130 pages so this may have been answered already. Everyonce in a while a order will come thru and oSCommerce will set the order to pending. but then nothing else will happen. I dont get any emails, or anything. But the order does show up in the admin panel. IPN is the only paypment module Im using and recently I've had 5 orders with thsi problem. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Hi,

I am having trouble with the paypal payment page language. I'm testing right now, my store is in 3 languages, and when checking out from the Spanish version of the store, the paypal payment page that appears when clicking on the "confirm order" button is in English, not in Spanish as it should logically be. How can I do to get the paypal page in Spanish or in French according to the language the client is using? Please need your very much appreciated help!!!!

 

Boliviasfinest

Share this post


Link to post
Share on other sites

I'm sorry for the repost...

my client is getting impatient and I havent received any clue about my problem...

Basically, is it normal for me to receive this Paypal IPN invalid process email??

I think not but before to do a test with the LIVE server, I would really appreciate some advice :)

 

 

Subject PayPal IPN Invalid Process

 

$_POST:

 

txn_type=web_accept

payment_date=04:46:44 May 06, 2007 PDT

last_name= las name

residence_country=NL

pending_reason=unilateral

item_name=the Gathering webshop

payment_gross=

mc_currency=EUR

payment_type=instant

verify_sign=ABkf-Fki.z9qZvQYNep-9SIEQzAVARfvpw4TD3dvcRHcnxGld1rqnopf

payer_status=unverified

test_ipn=1

tax=0.00

payer_email=email@domain.com

txn_id=0

quantity=1

receiver_email=email@domain.com

first_name=ALex

invoice=G43

payer_id=Z5V2HMPWTLM46

item_number=

payment_status=Pending

shipping=0.00

mc_gross=6.35

custom=2

charset=windows-1252

notify_version=2.1

 

$_GET:

 

 

On sandbox.paypal.com I can see the following lines per order

so I guess this is working.. why do I get this email then??

Payment To payment@gathering.nl 6 May 2007 Unclaimed Details Cancel -€24,65 EUR €0,00 EUR

Transfer From Credit Card 6 May 2007 Completed Details €24,65 EUR €0,00 EUR

Cheers

Edited by Burntheweb

Share this post


Link to post
Share on other sites
I'm testing right now, my store is in 3 languages, and when checking out from the Spanish version of the store, the paypal payment page that appears when clicking on the "confirm order" button is in English, not in Spanish as it should logically be.

Assuming you are using one of the latest contrib packages, then the PayPal language is based on the customer's main address country. NB: this is not the shipping or billing address but the primary address. The code in the paypal_ipn.php which handles this is:

  $parameters['lc'] = $order->customer['country']['iso_code_2'];

To check how it works you will need to set up a customer account with the primary country Spain / France etc. Just selecting the language in the shop won't work as PayPal works with country ISO codes, not language codes. Hope this helps - Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites

I just installed V2,2 today to ms2.2

 

and no matter what, i always get the invoice is already paid...

 

i even set "No, allow multiple payments per invoice ID" and it still complains

that its paid

 

anyway to debug what its sending to paypal?

 

thanks

mitch

Share this post


Link to post
Share on other sites
I just installed V2,2 today to ms2.2

 

and no matter what, i always get the invoice is already paid...

 

i even set "No, allow multiple payments per invoice ID" and it still complains

that its paid

 

anyway to debug what its sending to paypal?

 

thanks

mitch

 

Check the folder helpfiles!! I had the same issue and it was easily solved... ;)

After that if you can help me with my issue (see above), be my guest

Share this post


Link to post
Share on other sites

i did look at the helpfiles...

 

does that apply to me?

 

i only have 1 store...

 

 

if it does, it should have been already there, so i dont think that is it...

each id still should be unique

 

help

 

mitch

Share this post


Link to post
Share on other sites
Assuming you are using one of the latest contrib packages, then the PayPal language is based on the customer's main address country. NB: this is not the shipping or billing address but the primary address. The code in the paypal_ipn.php which handles this is:

  $parameters['lc'] = $order->customer['country']['iso_code_2'];

To check how it works you will need to set up a customer account with the primary country Spain / France etc. Just selecting the language in the shop won't work as PayPal works with country ISO codes, not language codes. Hope this helps - Terra

 

Thanks a lot for your answer. I created an account (in my store that is) where the user country is Bolivia, went through all the process of purchasing an item but again when getting to the confirm order and from there to paypal, the page that shows up is still in english. Is there any define or code that I should be writing somewhere? maybe in the includes/languages/spanish/modules/payment/paypal_ipn.php file? or anywhere else? Thanks again for your help!

 

Boliviasfinest

Share this post


Link to post
Share on other sites
Thanks a lot for your answer. I created an account (in my store that is) where the user country is Bolivia ...

PayPal only supports a limited number of countries and as far as I know Bolivia is not one of them. This means that any customer with an address in Bolivia is directed to the default US page. From the PayPal Dev forum:

Country Codes AU, DE, FR, IT, GB, ES and US are supported. Any other value will default to US.

So you could hardcode the parameter lc to ES for Spanish or maybe write your own code so customers with an address in Bolivia get the Spanish page (via a PHP if statement):

 $parameters['lc'] = 'ES';

Hope this helps to explain it! Terra


My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Share this post


Link to post
Share on other sites

I emailed myself back the array, it looks ok?

yet the sandbox says its paid, i have confirmed invoice does change with each cart

 

Q if im not using SSL, what happens if the TEMP directory isnt correct

its vauge what i got to put in there.. if it was a relative path, id need to know what level im at

i made a directory Temp in the "catalog" directory (root) and made it chmod 777

i put in the box the path to that directory from my root /users/....

id rather do a relative path my guess "../../../Temp"

 

Array
(
   [cmd] => _cart
   [upload] => 1
   [item_name_1] => Toslink Optical input
   [amount_1] => 15.00
   [tax_1] => 0.00
   [quantity_1] => 1
   [shipping_1] => 0.00
   [on0_1] => Sound Card Type
   [os0_1] => Audigy 2
   [num_cart_items] => 1
   [amount] => 15.00
   [business] => xxxxxx.net
   [no_shipping] => 2
   [address_name] => Mitchell s
   [address_street] => 123 anystreet
   [address_city] => anytown
   [address_zip] => 18699
   [address_state] => PA
   [address_country_code] => US
   [address_country] => United States
   [payer_email] => xxxxxx.net
   [currency_code] => USD
   [invoice] => 17
   [custom] => 2
   [no_note] => 1
   [notify_url] => [url="http://www.xxxxxx.net/mkportal/modules/oscommerce/ext/modules/payment/paypal_ipn/ipn.php"]http://www.xxxxxx.net/mkportal/modules/osc...pal_ipn/ipn.php[/url]
   [cbt] => Complete your Order Confirmation
   [return] => [url="http://www.xxxxxx.net/mkportal/modules/oscommerce/checkout_process.php?osCsid=4255c2dc1a3cf4328030018df265be85"]http://www.xxxxxx.net/mkportal/modules/osc...030018df265be85[/url]
   [cancel_return] => [url="http://www.xxxxxx.net/mkportal/modules/oscommerce/checkout_payment.php?osCsid=4255c2dc1a3cf4328030018df265be85"]http://www.xxxxxx.net/mkportal/modules/osc...030018df265be85[/url]
   [bn] => osCommerce PayPal IPN v2.1
   [lc] => US
)

 

thanks

-Mitch

Share this post


Link to post
Share on other sites

ok, never mind on the SSL thing

 

i found the IF, the temp dir is not used at all when no encryption

 

mitch

Share this post


Link to post
Share on other sites
I havent had a chance to read thru all 130 pages so this may have been answered already. Everyonce in a while a order will come thru and oSCommerce will set the order to pending. but then nothing else will happen. I dont get any emails, or anything. But the order does show up in the admin panel. IPN is the only paypment module Im using and recently I've had 5 orders with thsi problem. Any help would be greatly appreciated.

 

 

I've looked thru all the info I can find and nothing still. I have 5 huge orders waiting for this problem to be fixed. Any help at all?

Share this post


Link to post
Share on other sites

:( no one helping me so far :'(

 

LOL well maybe you dont know then... :S I'll have to dig the shit alone then ;)

Share this post


Link to post
Share on other sites

OK, THIS is odd

 

when i go live, paypal accepts the payment

in the sandbox, it says already paid...

 

but now a new problem, and alot of people have this problem

 

paypal never hits me back with update

 

the RPN doesnt happen

 

i put a mail(... at the top of ipn.php

and i never get an email...

 

register_globals is off, and will remain off, my host does not want it on, and i dont blame him

 

but i dont even get the Post from paypal... so i havent gotten that far

 

i can do it myself with a post, so the ipn.php is accessable

 

any ideas?

 

mitch

Share this post


Link to post
Share on other sites
Do you accept EUR in your PayPal account profile?

 

You need to install register globals patch first.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Share this post


Link to post
Share on other sites

Excuse me my English. I'am Italian.

 

I have just installing PayPal IPN v2.2... GREAT!!!!!

 

I have a question: how to set the return page to my store and how to send the email notifications in the file checkout_success.php?

 

Thanks very much for the assistance...

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

×