Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official PayPal IPN Support Thread


Mark Evans

Recommended Posts

I am still having these errors .. any thoughts? I couldn't find the IPN module in the location stated.

 

Hello,

 

I have read this thread into my eyes popped out and searched the entire forum for this. I found a few items but nothing exact. If this answer is included in this thread, I do aplogize but I didn't see it.

 

We had a total of 4 orders and the results are:

 

3 orders NOT in oscommerce -- Unverified, Unregistered Paypal users

 

1 order that did go into oscommerce -- Verified & Registered Paypal member.

 

It's a trend and appears that unverified orders aren't showing in OS Commerce.

 

Any advice on this?

Jason Miller

www.jamz.net

Link to comment
Share on other sites

Also notice that your key/cert don't look like a pair to me. Please make sure they are in X.509 RSA 1024bit PEM encoded key/cert pair.

Thanks for the info. Will give it a try and let you know how I make out.

Bob

Link to comment
Share on other sites

Can anyone tell me how to get the order number back into the subject line of the emails when using PayPal IPN?

Can I just edit the EMAIL_TEXT_SUBJECT in the language file, and if so, how would I do that

The PayPal IPN re-uses the language-level checkout_process.php file. However, variables differ between checkout_process and ipn.php so to keep things tidy, I'd recommend:

 

1. In /english/checkout_process.php (or whatever language you use) add this line:

define('EMAIL_TEXT_SUBJECT_IPN', 'Order Process: %s');

2. In ipn.php replace all instances of EMAIL_TEXT_SUBJECT with

sprintf(EMAIL_TEXT_SUBJECT_IPN, $_POST['invoice'])

 

I haven't tested this but in theory it should work fine. By creating a new subject which is only used by the IPN, you avoid any problems with other payment modules & can use the $_POST variable.

 

all the best, Terra

 

Keywords: PayPal IPN email subject order number

Edited by 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 **

Link to comment
Share on other sites

Hi Terra,

I really do appreciate your patience on this one. :)

 

As I mentioned here:

 

I'm trying as much as possible to work out all the issues before I go on a live server with this. Just my naturally cautious nature, I guess. It did occur to me that the interaction with the PayPal Sandbox might not work with the cart being offline but I thought I'd give it a shot. To my surprise a lot of it did work and I assumed that if the link-back didn't work it would give me a message like "unable to locate the url... yada yada".

 

In fact, when I click the "Return to Kandy Land" link on the (https://www.sandbox.paypal.com/cgi-bin/webscr) PayPal site, it returns me seamlessly to my offline shopping cart. This is what made me think the error might be in the PayPal IPN module or some related page(s) on the site. It is possible, I suppose that with the cart being offline, the PayPal site, on completion of the transaction, messes up somehow.

 

The only way I can track that down would be to make myself much more familliar with PHP and try to follow the sequence step by step. I'm torn. Do I leave this part of the operation and go on to the rest, assuming this part will work? I was kinda hoping to get thoroughly familliar with all phases of the cart including finalizing the transaction, the various reports, stock lists, errors, etc.

 

Anyway, like you said, you're stumped and your point about no one else having a problem is very valid! So leave it with me to struggle along on this.

 

Thanks again for your efforts on my behalf. I do appreciate it. :thumbsup:

 

-Hank

 

Hi Terra,

 

In case you should be checking this post, I thought I'd let you know that putting the "cart" on a live server did solve this issue. :thumbsup:

 

Thanks again for your help on this!

 

-Hank

Link to comment
Share on other sites

Hi all.

on the weekend I installed QTPOR 4.3 as well as the files to make it work with IPN_v2.2. Since then I'm not able to pay in the sandbox with CC only (no paypal account). I get the error "Some information is incorrect or missing. ..." but everything is specified. Has anyone an idea what went wrong?

Thanks.

Link to comment
Share on other sites

Hi all.

on the weekend I installed QTPOR 4.3 as well as the files to make it work with IPN_v2.2. Since then I'm not able to pay in the sandbox with CC only (no paypal account). I get the error "Some information is incorrect or missing. ..." but everything is specified. Has anyone an idea what went wrong?

Thanks.

 

I found the problem - I used a city and zip which does not match. It looks like paypal is checking for that but unfortunately giving you no clue what's wrong if you have a mismatch.

Link to comment
Share on other sites

Hi alex

 

I've read your previous post. I want to use IP recorder too. I'm using OSC Paypal IPN 2.2. Should I follow your instruction below and the instruction of IP recorder? I notice that your instrution is for OSC Paypal IPN 1.1. Will it good for OSC Paypal IPN 2.2 too ? Is there anything I might need to do ?

 

Thanks for your help.

 

Regards

Jason

 

 

OK, I have solved the problem by myself. Just put these codes
$ip = $_SERVER['REMOTE_ADDR'];
 $client = gethostbyaddr($ip);
 $str = preg_split("/\./", $client);
 $i = count($str);
 $x = $i - 1;
 $n = $i - 2;
 $isp = $str[$n] . "." . $str[$x];

to the file catalog/includes/modules/payment/paypal_ipn.php, in fron of this block

 $sql_data_array = array('customers_id' => $customer_id,
							  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
							  'customers_company' => $order->customer['company'],
							  'customers_street_address' => $order->customer['street_address'],
							  'customers_suburb' => $order->customer['suburb'],
							  'customers_city' => $order->customer['city'],
							  'customers_postcode' => $order->customer['postcode'],
							  'customers_state' => $order->customer['state'],
							  'customers_country' => $order->customer['country']['title'],
							  'customers_telephone' => $order->customer['telephone'],
							  'customers_email_address' => $order->customer['email_address'],
							  'customers_address_format_id' => $order->customer['format_id'],
							  'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
							  'delivery_company' => $order->delivery['company'],
							  'delivery_street_address' => $order->delivery['street_address'],
							  'delivery_suburb' => $order->delivery['suburb'],
							  'delivery_city' => $order->delivery['city'],
							  'delivery_postcode' => $order->delivery['postcode'],
							  'delivery_state' => $order->delivery['state'],
							  'delivery_country' => $order->delivery['country']['title'],
							  'delivery_address_format_id' => $order->delivery['format_id'],
							  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
							  'billing_company' => $order->billing['company'],
							  'billing_street_address' => $order->billing['street_address'],
							  'billing_suburb' => $order->billing['suburb'],
							  'billing_city' => $order->billing['city'],
							  'billing_postcode' => $order->billing['postcode'],
							  'billing_state' => $order->billing['state'],
							  'billing_country' => $order->billing['country']['title'],
							  'billing_address_format_id' => $order->billing['format_id'],
							  'payment_method' => $order->info['payment_method'],
							  'cc_type' => $order->info['cc_type'],
							  'cc_owner' => $order->info['cc_owner'],
							  'cc_number' => $order->info['cc_number'],
							  'cc_expires' => $order->info['cc_expires'],
							  'date_purchased' => 'now()',
							  'orders_status' => $order->info['order_status'],
							  'currency' => $order->info['currency'],
							  'currency_value' => $order->info['currency_value'],
							  'ipaddy' => $ip,
							  'ipisp' => $isp);

NOTICE The last 2 lines are added follow by the IP Order Recorder contrib mentioned in my last post.

 

Now IP Order Recording is working with osC PayPal IPN in my store. You might need PHP4.10 in your host to use the codes I modified.

Link to comment
Share on other sites

Hi there - installed this module and seems to work fine.

 

Can I change the number of options available: "Pending", "Processing", "Delivered", "Preparing"? There doesn't appear to be an option for "Refunded" so I would like to add one.

 

Apologies if this has already been posted - I looked through but may have missed it.

 

Great contribution by the way - thanks.

Link to comment
Share on other sites

Hi there - installed this module and seems to work fine.

 

Can I change the number of options available: "Pending", "Processing", "Delivered", "Preparing"? There doesn't appear to be an option for "Refunded" so I would like to add one.

 

Apologies if this has already been posted - I looked through but may have missed it.

 

Great contribution by the way - thanks.

 

you can add stauts at Admin > Localization > Order Status

Link to comment
Share on other sites

Hi alex

 

I've read your previous post. I want to use IP recorder too. I'm using OSC Paypal IPN 2.2. Should I follow your instruction below and the instruction of IP recorder? I notice that your instrution is for OSC Paypal IPN 1.1. Will it good for OSC Paypal IPN 2.2 too ? Is there anything I might need to do ?

 

Thanks for your help.

 

Regards

Jason

It's good for OSC Paypal IPN up to v2.2.

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.

Link to comment
Share on other sites

Hello again

 

I now have the IPN working well.

 

I want to use one of the "Payment Without Account" options as I want customers to go straight to checkout without registering.

 

This contribution; http://www.oscommerce.com/community/contributions,355/ works well but it is bypassed by the PayPal IPN contribution.

 

Has anyone successfully installed both contributions and can they share the code modifications necessary?

 

If not I am prepared to have a go myself, but of course don't want to reinvent the wheel if it's already been done.

 

Thanks again for the great community support here.

 

James

Link to comment
Share on other sites

At the suggestion of Terra, I have installed version 1.3 because I have CCGV and Affiliates contribs on my site. Works OK, so far, but I'd like to install 2.2, and I was wondering...

 

I have compared the file paypal_ipn.php vor version 1.3 and 2.2, and oh! joy, I can pretty much place all the CCGV and Affiliate code in 2.2 at pretty much the same place they are located in teh code of 1.3. Except for one, itsy-bitsy line of contrib.

 

In 1.3, there is a chunk of code to send email to the customer. It starts with:

// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" .

 

Right above that in 1.3, we are to place the following line of code:

$order_total_modules->apply_credit();// CCGV

 

But! In 2.2, there does not seem to be any such thing as email confirmation code. So my question is, is that email code located somewhere else, or is there simply no email confirm in 2.2? I can't believe we can just ignore that call to the apply_credit() function. Would anybody know?

 

Thanks,

 

Zorglub.

Link to comment
Share on other sites

At the suggestion of Terra, I have installed version 1.3 because I have CCGV and Affiliates contribs on my site. Works OK, so far, but I'd like to install 2.2, and I was wondering...

 

I have compared the file paypal_ipn.php vor version 1.3 and 2.2, and oh! joy, I can pretty much place all the CCGV and Affiliate code in 2.2 at pretty much the same place they are located in teh code of 1.3. Except for one, itsy-bitsy line of contrib.

 

In 1.3, there is a chunk of code to send email to the customer. It starts with:

// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" .

 

Right above that in 1.3, we are to place the following line of code:

$order_total_modules->apply_credit();// CCGV

 

But! In 2.2, there does not seem to be any such thing as email confirmation code. So my question is, is that email code located somewhere else, or is there simply no email confirm in 2.2? I can't believe we can just ignore that call to the apply_credit() function. Would anybody know?

 

Thanks,

 

Zorglub.

Link to comment
Share on other sites

At the suggestion of Terra, I have installed version 1.3 because I have CCGV and Affiliates contribs on my site. Works OK, so far, but I'd like to install 2.2, and I was wondering...

 

I have compared the file paypal_ipn.php vor version 1.3 and 2.2, and oh! joy, I can pretty much place all the CCGV and Affiliate code in 2.2 at pretty much the same place they are located in teh code of 1.3. Except for one, itsy-bitsy line of contrib.

 

In 1.3, there is a chunk of code to send email to the customer. It starts with:

// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" .

 

Right above that in 1.3, we are to place the following line of code:

$order_total_modules->apply_credit();// CCGV

 

But! In 2.2, there does not seem to be any such thing as email confirmation code. So my question is, is that email code located somewhere else, or is there simply no email confirm in 2.2? I can't believe we can just ignore that call to the apply_credit() function. Would anybody know?

 

Thanks,

 

Zorglub.

Link to comment
Share on other sites

hello...i would like to ask something...when i have a payment that costs 300,00 euros and i continue to pay in paypal in appears in total tha amount of 331.09

why is that difference? is that because paypal take some money for the payment?

 

thanks a lot

Link to comment
Share on other sites

The PayPal IPN re-uses the language-level checkout_process.php file. However, variables differ between checkout_process and ipn.php so to keep things tidy, I'd recommend:

 

1. In /english/checkout_process.php (or whatever language you use) add this line:

define('EMAIL_TEXT_SUBJECT_IPN', 'Order Process: %s');

2. In ipn.php replace all instances of EMAIL_TEXT_SUBJECT with

sprintf(EMAIL_TEXT_SUBJECT_IPN, $_POST['invoice'])

 

I haven't tested this but in theory it should work fine. By creating a new subject which is only used by the IPN, you avoid any problems with other payment modules & can use the $_POST variable.

 

all the best, Terra

 

Keywords: PayPal IPN email subject order number

 

Thanks Terra.. that sort of works, as the email does show the order number, but when I get sent back to the site from paypal, I get this error:

 

 Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/members/catalog/includes/languages/english/modules/payment/paypal_ipn.php:91) in /home/xxx/public_html/members/catalog/includes/functions/general.php on line 29

 

Any further assistance would be appreciated.

 

Thanks!

Edited by canajun
Link to comment
Share on other sites

I'm testing this module to replace the paypal "classic" module..

I'm trying to set the module on the "testing server" but when I log in in Sandbox.paypal.com it tells me the invoice was already apaid and I should contact the merchant...

Is this a known bug? Can someone tell me a possible solution then?

 

I dont use any encryption at the moment to send the data to paypal website...

 

Thanks in advance

Link to comment
Share on other sites

I'm trying to set the module on the "testing server" but when I log in in Sandbox.paypal.com it tells me the invoice was already apaid and I should contact the merchant...
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.

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

Link to comment
Share on other sites

hello...i would like to ask something...when i have a payment that costs 300,00 euros and i continue to pay in paypal in appears in total tha amount of 331.09 why is that difference? is that because paypal take some money for the payment?

Check your PayPal account settings (in your PayPal account) - this occurs e.g. when you set up a shipping charge or similar in your PayPal account. PayPal does not add anything to the value unless you have specified it in your account settings. All the best - 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 **

Link to comment
Share on other sites

 Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/members/catalog/includes/languages/english/modules/payment/paypal_ipn.php:91) in /home/xxx/public_html/members/catalog/includes/functions/general.php on line 29

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

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

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