Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
AlexStudio

Installation Guide - osC Paypal IPN 1.1 + Downloads Controller 5.3 - on fresh osC MS2.2

Recommended Posts

Robert, you should also post this to the official osC PayPal IPN support thread, to see if there is anyone who can help. I'm not a programer, nor knowing how exactly the IPN module works. The only thing I know for sure in your case is, that the communication between your site and PayPal side is not working properly, and it's nothing to do with the Download Controller contrib.

 

There are no statement about the .htaccess setting in the Install guide come with the osC PayPal IPN module. I don't think it was the problem. For your reference, I'm going to check those settings on my site.

 

Since you have posted the POST and GET results here, I suggest you to change the email address and password you set with your PayPal account before your store goes to live envirement, for security reason.

 

 

Its a testing site. All password will be changed. Thanks I willl post in the contribution support. Thanks

Share this post


Link to post
Share on other sites

Robert, the function which actually 'POST' and 'GET' is in the ipn.php which is under the ext directory. You don't need to change the permission of it, for it was set exactly as what it should be, in the contrib package. The ipn.php is set 644, and all folders under 'ext' are 755.

 

While I was checking the php codes in the ipn module, I found that you have to setup your osC correctly with both HTTP and HTTPS server domain, otherwise it will not work. Please check these settings in your catalog/includes/configure.php , especially the HTTPS settings.

Edited by AlexStudio

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

Hiya AlexStudio... so good your guide... but i'm still on first step: Installing and using PayPal IPN payment module 1.3. It's the best post i'v read about this, but i'v a little problem.

 

Ever i do a paypal IPN payment trhought sandbox of course, and after i get authenticated, i get :

"this shipping payment is already done, contact the seller for more info..."

 

One of the paypal staff guys tell me that the payment button has the same IPN each time ???? i dont undestant, what can i do?

 

Thanks in advance...

Share this post


Link to post
Share on other sites
Hiya AlexStudio... so good your guide... but i'm still on first step: Installing and using PayPal IPN payment module 1.3. It's the best post i'v read about this, but i'v a little problem.

 

Ever i do a paypal IPN payment trhought sandbox of course, and after i get authenticated, i get :

"this shipping payment is already done, contact the seller for more info..."

 

One of the paypal staff guys tell me that the payment button has the same IPN each time ???? i dont undestant, what can i do?

 

Thanks in advance...

Try this, either register another dealer's ID in sandbox, or modify the order ID in your database to a much higher value. Your problem looked like duplicated order IDs in sandbox which had been used before. Let me know if none of these work.


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
Try this, either register another dealer's ID in sandbox, or modify the order ID in your database to a much higher value. Your problem looked like duplicated order IDs in sandbox which had been used before. Let me know if none of these work.

 

Hiya AlexStudio, first of all thnx for your answer, and thnx for the tutorial.

I'v solved the 'already payment done' mistake. I think it was the IPN url i'd put in PayPal seller configuration.

 

I'm only using osCommerce MS2.2 (latest) with Paypal IPN 1.3 (latest). Still not installed download controller. I try to buy a product with shipment or another trought download. I can pay and finish in Paypal Sandbox all the proccess (in both cases, with shipment or download), including to see the Paypal receipt, etc. and i get a new order status in my osCommerce installation. (i know i would like to use download i'v to use Download Controller or any contribution similar).

 

But i recive this status: "PayPal IPN Invalid [Completed]"

 

I receive too an email with same text as subject and the next mess body:

 

" $_POST:

 

payment_date=06:04:08 May 23, 2006 PDT

txn_type=web_accept

last_name=my last name

residence_country=ES

item_name=My Eshop - TEST

payment_gross=

mc_currency=EUR

business=mybussinesemail@email.com

payment_type=instant

verify_sign=AnNMT7nRteKS2auTkxdsRz9rRvvPAHagtjI0pTvYqBAVxF-pLlDdblKi

payer_status=verified

test_ipn=1

tax=0.00

payer_email=buyer@email.com

txn_id=29W71889WF071490N

quantity=1

receiver_email=mybussinesemail@email.com

first_name=Comprador

invoice=23

payer_id=MNCVUMTEAXR8Q

receiver_id=4J93YG8Z5EQPU

item_number=

payment_status=Completed

payment_fee=

mc_fee=0.96

shipping=6.00

mc_gross=18.00

custom=2

charset=windows-1252

notify_version=2.1

 

$_GET:

"

 

Could u or anyone here help me?

Thanks in advance.

Share this post


Link to post
Share on other sites

You must set the same currency for both at ipn module setting page and sandbox, to avoid the Invalid but Completed ipn feed back.


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
You must set the same currency for both at ipn module setting page and sandbox, to avoid the Invalid but Completed ipn feed back.

 

Thnx again for your help Alexstudio.

 

- I dont undestand waht d u mean with 'set same currency for both...'. D u mean that i'v to put in paypal ipn payment module (under my osCommerce installation) the "Transaction Currency" (i'v now "only Eur") same value in Paypal sandbox "currency balances" (i'v now Eur -> Primary open, and all other closed) ??? I think it's the same, but still invalid but completed.

 

- Another question, if you grant me, i'v to put in Paypal sandbox, under the seller profile the "Instant payment notificacion" url to: "http://mydomain/catalog/includes/modules/payment/paypal_ipn.php" or to "

http://mydomain/catalog/ext/modules/paymen...n/ipn.php" ?? I can see in my web access_log file that ipn sandbox goes trougth last i put...

 

- I'v put in "Set Preparing Order Status" Preparing [PayPal IPN] i think it's ok. But in

"Set PayPal Acknowledged Order Status" i'v Default... is that i'v to have??

 

Thnx again.... !!!

Share this post


Link to post
Share on other sites

I just checked paypal website, you might need to modify the IPN module to accept EUR. Try USD first to see if the Invalid but Completed still there. The currency setting of sandbox is under profile->payment receiving preferences

 

You can skip the IPN url settings. Leave it blank.

 

The 'Set PayPal Acknowledged Order Status' is for order status which has been successfully processed. Changing that setting will not do anything to the 'Invalid but Completed' problem.


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
I just checked paypal website, you might need to modify the IPN module to accept EUR. Try USD first to see if the Invalid but Completed still there. The currency setting of sandbox is under profile->payment receiving preferences

 

You can skip the IPN url settings. Leave it blank.

 

The 'Set PayPal Acknowledged Order Status' is for order status which has been successfully processed. Changing that setting will not do anything to the 'Invalid but Completed' problem.

Thnx Alexstudio, like ever... :-)

I'v tried with USD and invalid again... people from paypal in sandbox forums told me that i'v to send all the variables to paypal trought ipn, and it seems that paypal ipn payment module doesnt sends all (not only needed, all....)

 

Do you knew something about?

 

Thnx again.

Share this post


Link to post
Share on other sites

the osC IPN module is working fine with my store, and many others' as well. If somebody said that there is something wrong in the ipn module, well, you have to think about that again.


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
the osC IPN module is working fine with my store, and many others' as well. If somebody said that there is something wrong in the ipn module, well, you have to think about that again.

 

First of all, lot o Thanks for your help, Alex... I can imagine that the module is working so well to all the people, but i dont understand why, in my case, isnt running ok, and i get allways invalid.

 

In my osCommerce site:

- I'v deleted currencies and i have only USD.

- In the configuration of the paypal ipn module, i'v put the Currency to Only USD (tried too with Selected

Currency)

 

In Sandbox:

- I'v a seller account, with only a balance with USD currency.

- I'v a buyer account, with only a balance with USD currency.

 

I log into Sandbox, go to my osCommerce site, i do an order, select Paypal IPN as payment mode, i can check in Sandbox payment pages the order ok, the amounts ok (in USD), i do the payment and all is ok.

 

But i ever get and PayPal IPN Invalid Process.... but completed transaction.

 

I post here the paypal ipn module configuration:

 

Enable PayPal IPN Module True

Move tax to total amount False

Mail Address [sandbox seller email address]

Transaction Currency Only USD (tried too Selected Currency]

Payment Zone None

Set Preparing Order Status Preparing [Paypal IPN]

Set PayPal Acknowledged Order Status Default

Gateway Server Testing

Transaction Type Per Item

Page Style Paypal

Debug E-Mail Address [my real email]

Sort order of display 0

Enable Encrypted Web Payments False

OpenSSL Location /usr/bin/openssl

 

 

 

Thnx again....

Share this post


Link to post
Share on other sites

Hey Alex,

 

Very nice work here! I printed out your instructions a while back and after days of struggling without them, POOF! I had everything working fine in a matter of hours. Thank you for that!

 

I'm currently tweaking and refining my setup and need to know if, and how, I can get my downloads outside of the public_html folder and working with OSC. Any ideas?

 

I'm also still trying to find a solution to having my OSC setup (MySQL dbase, downloads controller & Paypal IPN) handle ALL my sales, including those that originate outside of my website (eBay, etc.). Any ideas here too? I've found commercial programs that are in PHP and MySQL that can securely and automatically handle ALL my sales (from OSC, eBay, Yahoo, etc.) so I figure you?ve got to be able to modify OSC to accomplish the same thing. Am I wrong? I?d prefer to have one customized program (OSC) handle everything, rather than multiple programs trying to coordinate and communicate with each other.

 

Thanks,

Taz

Edited by Tazzy12

Share this post


Link to post
Share on other sites

Sorry, I can't help you on both of your questions. I think it is possible to put the download files in other folders, but I didn't try that. Handling eBay and ALL other sells from a single osC is way beyond my knowledge. You need a PRO to have it done nicely.

Edited by AlexStudio

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

Thanks, Alex.

 

You sound like a PRO to me! :D

 

I've actually been trying to find an OSC person to help me, but so far no luck. I'm seriously considering giving up on OSC and going with something less complicated and with more personal support.

 

Thanks anyway.

 

Taz

Share this post


Link to post
Share on other sites

Hiya all my friends!! Specially AlexStudio who helps me to solve my problems...

 

Now i'v to tell to you that i finally get VERIFIED from Paypal!!!! My problem was in /ext/modules/payment/paypal_ipn/ipn.php. I'd to comment the lines that check for CURL in my page or in my server.... Hosting company doenst like it, but has some components of curl but no activated or something like this.

 

IPN.PHP:

Line 34: // } elseif (function_exists('curl_exec')) { -> just Commented

Line 35: // $curl = true; -> just Commented

 

I explain this to others users than get the INVALID ipn from paypal and don't know what's happening...

 

I get Verified by Paypal, BUT NOW Downloads never are avaliable... :-(

 

I'v followed step by step this AlexStudio Installation guide...

 

I'v uploaded all 3 folders under /catalog/ from Download_Controllerv5.3 MS2.2_2.zip contribution, and i dont know if include the 2 files there are in archive /catalog/ (checkout_process.php and checkout_shipping.php), but i'v uploaded too.

 

I'v created the new orders status like that (inside () spanish lang (lang_id 3):

 

1 Pending (1 Pendiente) (default)

2 Processing (2 Proceso)

3 Payment Procesing (3 Procesando Pago)

4 Delivered (4 Entregado)

11 Downloads Now Available (5 Descargas Ya Disponibles)

12 Updated (12 Modificado)

 

I have this order_status table under my mysql ddbb (including english and spanish lang order status):

 

"

1 1 1 Pending

11 1 11 Downloads Now Available

1 3 1 Pendiente

2 1 2 Processing

2 3 2 Proceso

4 1 4 Delivered

4 3 4 Entregado

3 1 3 Payment processing

3 3 3 Procesando Pago

11 3 11 Descargas Ya Disponibles

12 1 12 Updated

12 3 12 Modificado

"

 

When i buy something (downloadeable of course, with his attributa download and a the file in the downloads folder) this is the order status:

 

14/06/2006 14:57:22 (green check mark) 4 Delivered

14/06/2006 14:57:32 (red check cross) 1 Pending PayPal IPN Verified [Completed (Verified; $2.77)]

 

Why?

 

PD: if i change the order status to updated, the download link appears i can Download the file.

 

Thnks in advance everybody and one who can help me, specially Alexstudio for his help!

Share this post


Link to post
Share on other sites
Hiya all my friends!! Specially AlexStudio who helps me to solve my problems...

 

Now i'v to tell to you that i finally get VERIFIED from Paypal!!!! My problem was in /ext/modules/payment/paypal_ipn/ipn.php. I'd to comment the lines that check for CURL in my page or in my server.... Hosting company doenst like it, but has some components of curl but no activated or something like this.

 

IPN.PHP:

Line 34: // } elseif (function_exists('curl_exec')) { -> just Commented

Line 35: // $curl = true; -> just Commented

 

I explain this to others users than get the INVALID ipn from paypal and don't know what's happening...

 

I get Verified by Paypal, BUT NOW Downloads never are avaliable... :-(

 

I'v followed step by step this AlexStudio Installation guide...

 

I'v uploaded all 3 folders under /catalog/ from Download_Controllerv5.3 MS2.2_2.zip contribution, and i dont know if include the 2 files there are in archive /catalog/ (checkout_process.php and checkout_shipping.php), but i'v uploaded too.

 

I'v created the new orders status like that (inside () spanish lang (lang_id 3):

 

1 Pending (1 Pendiente) (default)

2 Processing (2 Proceso)

3 Payment Procesing (3 Procesando Pago)

4 Delivered (4 Entregado)

11 Downloads Now Available (5 Descargas Ya Disponibles)

12 Updated (12 Modificado)

 

I have this order_status table under my mysql ddbb (including english and spanish lang order status):

 

"

1 1 1 Pending

11 1 11 Downloads Now Available

1 3 1 Pendiente

2 1 2 Processing

2 3 2 Proceso

4 1 4 Delivered

4 3 4 Entregado

3 1 3 Payment processing

3 3 3 Procesando Pago

11 3 11 Descargas Ya Disponibles

12 1 12 Updated

12 3 12 Modificado

"

 

When i buy something (downloadeable of course, with his attributa download and a the file in the downloads folder) this is the order status:

 

14/06/2006 14:57:22 (green check mark) 4 Delivered

14/06/2006 14:57:32 (red check cross) 1 Pending PayPal IPN Verified [Completed (Verified; $2.77)]

 

Why?

 

PD: if i change the order status to updated, the download link appears i can Download the file.

 

Thnks in advance everybody and one who can help me, specially Alexstudio for his help!

 

When i say:

11 Downloads Now Available (5 Descargas Ya Disponibles)

i would say:

11 Downloads Now Available (11 Descargas Ya Disponibles)

Share this post


Link to post
Share on other sites

What did you set in the admin page, under ipn module, for Set PayPal Acknowledged Order Status?

Edited by AlexStudio

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
What did you set in the admin page, under ipn module, for Set PayPal Acknowledged Order Status?

 

Hiya m8... i'v default... what i'v to have?

 

Thnks for ur help!

Share this post


Link to post
Share on other sites
Hiya m8... i'v default... what i'v to have?

 

Thnks for ur help!

 

 

SORRY I'V SEEN WHAT I'V TO DO:

 

I just seen next post from installation guide where u say i'v to had:

 

Set Preparing Order Status -> 3 Payment Processing

Set PayPal Acknowledged Order Status -> 11 Downloads now avalaible

 

I'v changed, tried and now i get still Downloads not avalaibles, and this status:

 

15/06/2006 3 Procesando Pago (3 Payment Processing)

15/06/2006 1 Pendiente PayPal IPN Verified [Completed (Verified; 3.48EUR)] (1 Pending PayPal IPN Verified [Completed (Verified; 3.48EUR)] )

 

I can see there u wrote: "Set PayPal Acknowledged Order Status to '101 Download Now Available'." Think it will be "11 Download Now Avaliable"

 

?? Thnks for ur help myfriend!

Share this post


Link to post
Share on other sites

There may be some problem in your ipn.php codes. While you get a VERIFIED result from sandbox, the codes in ipn.php under

if ($result == 'VERIFIED') {

take place (Line 78 in original ipn.php). And these lines (starting from line 95)

		$order_status_id = DEFAULT_ORDERS_STATUS_ID;

	if ($_POST['mc_gross'] == number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency']))) {
	  if (MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID > 0) {
		$order_status_id = MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID;
	  }
	}

	tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . $_POST['invoice'] . "'");

	$sql_data_array = array('orders_id' => $_POST['invoice'],
							'orders_status_id' => $order_status_id,
							'date_added' => 'now()',
							'customer_notified' => '0',
							'comments' => 'PayPal IPN Verified [' . $comment_status . ']');

	tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

will actually change the order status from what ever it was to what you set in Set PayPal Acknowledged Order Status.

 

As you mentioned, you have Set PayPal Acknowledged Order Status -> 11 Download Now Available, but you got 1 Pending PayPal IPN Verified [Completed (Verified; 3.48EUR)] instead. The only possibility I could think of is, there is something wrong with your codes.


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
There may be some problem in your ipn.php codes. While you get a VERIFIED result from sandbox, the codes in ipn.php under
if ($result == 'VERIFIED') {

take place (Line 78 in original ipn.php). And these lines (starting from line 95)

		$order_status_id = DEFAULT_ORDERS_STATUS_ID;

	if ($_POST['mc_gross'] == number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency']))) {
	  if (MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID > 0) {
		$order_status_id = MODULE_PAYMENT_PAYPAL_IPN_ORDER_STATUS_ID;
	  }
	}

	tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . $_POST['invoice'] . "'");

	$sql_data_array = array('orders_id' => $_POST['invoice'],
							'orders_status_id' => $order_status_id,
							'date_added' => 'now()',
							'customer_notified' => '0',
							'comments' => 'PayPal IPN Verified [' . $comment_status . ']');

	tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

will actually change the order status from what ever it was to what you set in Set PayPal Acknowledged Order Status.

 

As you mentioned, you have Set PayPal Acknowledged Order Status -> 11 Download Now Available, but you got 1 Pending PayPal IPN Verified [Completed (Verified; 3.48EUR)] instead. The only possibility I could think of is, there is something wrong with your codes.

 

 

Gonna check it! I'v changed "Set PayPal Acknowledged Order Status -> 4 Delivered" and ever get too 1 Pending....

 

Yesteday i'v commented 34 and 35 lines, and it only gets curl_exec check Off... my domain provider had some problems with curl... i think it is not related to this order_status change... but.... i'll check now...

 

Thanks Alex!

Share this post


Link to post
Share on other sites

I don't think what you did to line 34/35 can cause this problem. Another possibility is, there might be something wrong with your database.


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
I don't think what you did to line 34/35 can cause this problem. Another possibility is, there might be something wrong with your database.

 

I'v solved too.... i had in Paypal Sandbox a 16% spanish IVA tax, only applied in Paypal payment pages, not in my osCommerce store orders .... Without it, the total amount is the same than osCommerce order, and it changes the status to the status i'v choosed in Paypal IPN payment module config, as Paypal acknoledgment status... in this case, 11 Downloads Now Avaliable....

 

I'm triyng to put this IVA tax in IPN module, but if i add a Payment Zone, and a tax for it, and i select in Paypal IPN payment module config this Zone, the buyer cannot choose Paypal IPN Payment Method when it confirms the ShoppingCart... Will try something to solve...

 

Thnks all again ...

Share this post


Link to post
Share on other sites
I'v solved too.... i had in Paypal Sandbox a 16% spanish IVA tax, only applied in Paypal payment pages, not in my osCommerce store orders .... Without it, the total amount is the same than osCommerce order, and it changes the status to the status i'v choosed in Paypal IPN payment module config, as Paypal acknoledgment status... in this case, 11 Downloads Now Avaliable....

 

I'm triyng to put this IVA tax in IPN module, but if i add a Payment Zone, and a tax for it, and i select in Paypal IPN payment module config this Zone, the buyer cannot choose Paypal IPN Payment Method when it confirms the ShoppingCart... Will try something to solve...

 

Thnks all again ...

 

Tax mistake solved too!!!... thnx all!

Share this post


Link to post
Share on other sites

First off, thank you for creating these instructions for testing... Although, I am finding it difficult still to navigate through....

 

Ok, I agree I have no clue...lol...that said here are my stupid questions....

 

You state:

 

Then in the sandbox, seller's profile, Instant Payment Notification Preferences, turn IPN on, with the URL http://yourdomain/catalog/includes/modules.../paypal_ipn.php then save. However, everytime I input my domain url I get an error message, "We were unable to validate the URL you have entered. Please check your entry and try again." I am obviously missing something. Is there something else I have to do on my side to make the url recognizable??? The url that I entered is

 

http://absolutelybeautifulhairillusions/ca.../paypal_ipn.php

 

You state:

 

5. Upload a samll test.zip file to /catalog/download for later testing. The file size should be no larger than 1Mb. We want to make sure everything works fine before we approach forward. The smaller file seems to be less problematic. It doesn't matter what you put in the test.zip, but make sure you can unzip it without problem. Naming that .zip file is crucial for download to work properly later.

 

How do I create a samll test.zip file? I apologize but I am not a programmer and am a novice at this... I apologize for the questions...

 

Terry

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  

×