Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

Here is a weird problem I am having:

 

IPN works when the module is configured to be in test mode, immediate IPN response and I get the PayPal payment notification, IPN debug email, and order process emails almost instantly. However, when I take it out of test mode, IPN doesn't work anymore and I only get the PayPal payment notification.

 

Has anyone else run into this issue? I guess I can just leave the module in test mode, but that just doesn't sit well with me. Maybe I will dive into the code, but what exactly changes between test mode on and off?

 

I also gave up on getting sandbox.paypal.com to work, they should give you the option of mirroring existing, real, live paypal accounts.

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

Okay, I dived into the code, :wacko:

 

A clue is this in my IPN debug email:

 

------------------------------------------------------
Invalid PayPal Response
------------------------------------------------------
Connection Type
------------------------------------------------------
curl= 1, socket= , domain= www.paypal.com, port= 

PayPal Response
------------------------------------------------------
INVALID

 

Further digging around in catalog/ipn.php shows the following line:

  //post back to PayPal system to validate
 if(!$ipn->authenticate(MODULE_PAYMENT_PAYPAL_DOMAIN) && MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE == 'Off'); $ipn->dienice();

 

So if PayPal's response is INVALID, then the IPN process is sent off to die "nicely". No wonder I am not getting my IPNs. Note that this condition does not call dienice() if test mode is on - which is why IPN actually worked in test mode.

 

So $ipn->authenticate(MODULE_PAYMENT_PAYPAL_DOMAIN) is getting INVALID from PayPal. What exactly is being authenticated? Do I need something setup on PayPal's end to get this to work?

Link to comment
Share on other sites

Hi Lee, please ensure that you have configured your Primary Email address and your Business ID correctly, see the FAQs for more detail.

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

Link to comment
Share on other sites

Soren,

 

 

The location of send extra emails for the paypal ipn would be in checkout_update.inc.php right near the end of the file. In doing a quick grep for SEND_EXTRA_ORDER_EMAILS_TOon my box it seems that the code as Greg has it should do the trick. My lines from checkout_update are as follows:

 

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

 

 

Run a paypal payment in test mode and use the ipn test page from admin and echo the contents of SEND_EXTRA_ORDER_EMAILS_TO to see if it is full just before the if statmenet is run. You should then see the output at the top of the ipn test result page. I use this method when I screwing things up inside of the paypal code, maybee it can help you find why they arnet sent then.

Link to comment
Share on other sites

Just found out from a customer in Brazil that PayPal doesn't support special characters like ? ? ? ? ? in the billing address, giving customers the error message "You have entered unsupported characters such as ?. Only German and US characters are currently supported. Please use alternatives like e, then try again" (screen shot: http://www.visibone.com/products/UnsupportedCharacters.gif ).

 

Greg, you probably know this but thought I'd pass it along. I was thinking we could warn customers, or translate the characters ... but then there'd be no graceful way to turn that off, once PayPal started allowing special characters. Sigh.

 

Clicking on the Continue link sends people right back to where they can edit the order, which makes me think you already addressed this as best one can. ;-)

Link to comment
Share on other sites

Hi Bob,

Due to locale I wasn't previously aware of this, luckily however, Fabien has posted a solution which will be incorporated as is, since I'm not a linguistic polygot.

 

Seems like you will soon be able to compile a list of PayPal error codes and pages :D

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

Link to comment
Share on other sites

To follow up on the issue with PayPal rejecting credit cards or emails already associated with PayPal accounts, the moderator at paypaldev.org just locked the thread I had started for reporting customer problems. I thought I was in a discussion with someone who didn't want to believe it was happening to their customers, then I found out the hard way that was the moderator. Yikes.

 

http://www.paypaldev.org/topic.asp?TOPIC_ID=6443

 

And I didn't even post the angriest feedback letter I got from a customer...

Edited by Bob Stein, VisiBone
Link to comment
Share on other sites

Ok, perhaps a strange question, but I need to ask it anyway. I have been trying to get Paypal IPN and Authorize.net working on the same store at the same time (well, not on the same order, but as equally usable choices) for some time now. No matter what I do, I can only get one of them functional at a time. Has anyone here succeeded in getting the sort orders set in such a way as to allow both of these modules to be installed??

 

(The failure point for each module seems to be at the point where I change order totals sorts to please the other module).

 

I'd like to give more clues, but I also have a problem with either of these modules sending debug email, even though the stores email system does work.

 

Any helpful comments??

 

David

 

(btw - cross posted in both Paypal IPN and Authorize.net support threads, for obvious reasons).

Link to comment
Share on other sites

Bob, that's some very interesting to information.

 

Actually when I tested out a CC purchase via the PayPal Sandbox I then noticed that PayPal are not actually returning the customer with the required GET parameters, this is currently a problem for 2 reasons, the session id can be lost and the action parameter which clears the cart is also lost so when the customer returns they look like they didn't even finalize the payment; I was told that this was probably becasue I was using PDT, what that means I'm not sure although I could probably guess.

 

David, maybe if you could clarify

(The failure point for each module seems to be at the point where I change order totals sorts to please the other module).
What happens when you don't try to make any changes?

What happens when you use the original default osC authorize.net module?

Is it php logic causing the problem or because the html output is not well formed?

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

Link to comment
Share on other sites

Dunno if this is offtopic, but how are you guys dealing with partial refund, also I have been using the contribution orders editor which lets you manually add orders to a customers cart or add new accounts but i did anyone update it with paypal so it can send for money request?

 

Also if someone contacts you over the phone how would you put their order in? If you send a money request, you have to wait for them and hope that they'll respond and pay, and it's more work for the customer.

Link to comment
Share on other sites

David, maybe if you could clarify
(The failure point for each module seems to be at the point where I change order totals sorts to please the other module).
What happens when you don't try to make any changes?

What happens when you use the original default osC authorize.net module?

Is it php logic causing the problem or because the html output is not well formed?

Greg,

 

The html all seems to display ok, the problem is rejected transactions. And neither module sends debug emails, so its hard to pin down what the problem is. I think that is the first thing I need to solve. The server is a linux box, using sendmail, and it does send email from other modules (my link manager, the customer account modules, etc).

 

 

I will try to rerun my test transactions and post more information in the next day or so.

 

Thanks,

 

David

Link to comment
Share on other sites

To follow up on the issue with PayPal rejecting credit cards or emails already associated with PayPal accounts, the moderator at paypaldev.org just locked the thread I had started for reporting customer problems.

Hey Bob,

 

I've been following that thread too, what a bunch of wankers, with their "we don't care if your customers are upset, if you don't like it, get a real card card solution" style response.

 

They know they're cheap and easier to setup and thus they know they can be rude pricks like that unfortunately... Personally, I'd start another thread and just post more customer complaints into it. Don't say anything to rile them, just post your actual customer comments. Surely there's no harm in that.

 

Let us know if you start another thread... Maybe we need to start a petition :)

 

...Dono

Edited by Donovan
Link to comment
Share on other sites

Hi,

 

I'm using version 2.6a and having problems with updating order process.

 

When a customer is paying by using PayPal everything seems to be o.k. I got PayPal notification email. Payment status is instant and also completed. But the order status is not change from PayPal pending to pending - and furthermore there is no order email sent to me and the customer.

Link to comment
Share on other sites

Nico,

Bit difficult to tell without having more information about the transaction details and your config settings, however it would seem that maybe the Cart Test is preventing the order from being updated, does the debug email mention anything about this at the bottom, if things are ok nothing is mentioned otherwise if there was a problem it should be stated there. Have you performed an IPN Test via the IPN Test Panel?

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

Link to comment
Share on other sites

Hi again,

 

I checked debug mail again and found this at the end:

 

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

Check Total Amount

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

Wrong Total Amount

PayPal: 118.00

Session: 118.01EUR

 

 

Could this be the problem? An Amount of 118.00 EUR is giving to PayPal, but order_total says 118.01

If so, I think there is a little mistake of rounding total amount. But I do not know why this happend. In this example total amount is a sum of subtotal + shipping + extra PayPal surcharge. Every single amount is correct, but in total there is a difference of one cent.

Link to comment
Share on other sites

HI,

 

I am getting the following error when i try to access the order page in admin:

 

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/pecunia/public_html/hc/store/catalog/admin/orders.php on line 349

 

 

This is the code fragment from the orders.php

 

<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> //begin PayPal_Shopping_Cart_IPN

if (strtolower($order->info['payment_method']) == 'paypal' && isset($HTTP_GET_VARS['referer']) && $HTTP_GET_VARS['referer'] == 'ipn'){

?>

<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_PAYPAL, tep_get_all_get_params(array('action','oID','referer'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

<?php

} else {

?>

 

--

What is wrong?

 

Chris

Link to comment
Share on other sites

Problems with integrating the IPN contribution with old osc release (Octobert 2002).

 

I am tyring to implement the contribution to an old release of osc and was wondering if someone has experience in doing this? I am getting the system to work till a certain point, in the admin section I can't see any product info neither order totals are working fine.

 

Any feedback or suggestions would be appreaciated (I can't upgrade to ms2 since the system has been changed significantly)

 

Thanks!

radigyyy

Link to comment
Share on other sites

Hi !

 

i am new to PaPal website payments and i need some help. It seems that PayPal doesnt send my customers back to my website after they have paid - i am not receiving debugging emails and no order show up as sold. And because of this, the customers don't get a confirmation email :(

 

When i test it wit the IPN Test page provided with this contribution, everything is fine, but not in the real life. So i assume there is something wrong with the settings in my PayPal account.

 

Here are my PayPal settings:

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

I have a business account

 

I have set the IPN notification settings to "activated" and the URL to "mydomain.com/checkout_success.php"

 

Then, in Website Payment options i have "automated forwarding" on and also set to "mydomain.com/checkout_success.php" and "submitting of payment data" is on.

 

Am i missing something ? Thanks for any help !

 

P.S. Oh yeah - there was a discussion about that customers don't see the "If you don't have a paypal account click here" button and think that they can only pay by PayPal, not by credit card - no, if a customer don't have PayPal cookies on the machine, he will see the CC payment form :)

Link to comment
Share on other sites

Just received a new (to me anyway) kind of transaction from Paypal Germany:

 

Pending Bank Transfer:

The sender of the transaction listed below has received the information necessary to complete a bank transfer to you.

 

It is now the sender's responsibility to take the final steps to complete the transaction. If no action is taken within seven days, PayPal will email a reminder to the sender.

 

If the sender does not responded after 30 days, the transaction will be automatically cancelled. PayPal cannot require the sender to complete the transaction.

 

You will not be able to view this transaction in your PayPal Account Overview until three to four working days after the sender completes the payment.

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

 

I had hoped to see the end of paypal pending transactions but it seems they are back in a new guise. Is there any way to spot these in osCommerce rather than relying on the email from Paypal?

Link to comment
Share on other sites

Misc folder in PayPal_Shopping_Cart_IPN_v2.6a contains some kind of fix for OSC_Affiliate.

 

Does anybody know what this fix applies to or what it fixes in the Affiliate mod.

Edited by RI Downlink

I'm not a coder just a splicer.

Link to comment
Share on other sites

var/www/html/admin/orders.php on line 222

 

I have no clue how to fix this. The code in this section is below

 

<tr>

<?php

//begin PayPal_Shopping_Cart_IPN

 

if (strtolower($order->info['payment_method']) == 'paypal') {

 

include(DIR_FS_CATALOG_MODULES . 'payment/paypal/admin/orders.inc.php');

 

} else {

?>

<td><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>

<td class="main"><?php echo $order->info['payment_method']; ?></td>

</tr>

<?php

}//else not paypal

//end PayPal_Shopping_Cart_IPN

 

 

<?php

if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {

?>

 

 

 

Line 222 is the last 4 lines begin with <?php

 

Thanks all for helping.

Link to comment
Share on other sites

gregbaboolal: Nice code. I had a problem with the paypal_id and business_id on a clients account (because they didn't know what I was talking about) but in reading the debug responses I was able to figure it out pretty fast .... works like a charm now. Thanks.

(my knowledge is so small you would think that an ant was a genius in comparison)

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