Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

Make that Three! I have the same issue, no Paypal IPN info inserted in the order, shows Pending, Paypal account shows the transaction OK.  I have made NO site changes in the time frame of this starting to happen, so I'm wondering if Paypal made a code change?

 

 

lol, perhaps thats what happened. I recceived an order on 25th and it was all smooth, but the order I got yesterday had that problem. Hope a sollution can be found soon.

 

I checked paypal's IPN page and it doesn't say anything about any code change or something. Even they haven't changed their footer. It says "Copyright ? 1999-2004 PayPal."

 

Here is the PHP code that I found on Paypal's IPN page. I don't know if it has been changed or not.

 

PHP 4.1

// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';

foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}

// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);

// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];

if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
}
}
fclose ($fp);
}
?>

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

You know, it's a real pain doing this mod just as everyone starts having issues,lol

I have it all installed, but I'm not fully sure what should be happening now, I setup two paypal sandbox accounts, one for the store, one for a buyer.

Using the buyer account, I purchase at the store and go to checkout, I reach the paypal point(at this point OSC shows it as preparing) I pay,continue etc, now, buyers paypal shows as paid, shop paypal shows as received. transaction changes to pending? I'm guessing that's not correct? as it has cleared, should it not change to proccessing?

The thing that's really got me worried though, is that no emails are being sent out from OSC to me saying you have an order or you need to check someting, is that normal? even when I set up on the live server using $0.01 purchase and a friend pays real money.I get no indication that a purchase has been made? can someone point out anything I need to check please, I'm tired of these late nights,lol I just want it to go live.

Link to comment
Share on other sites

You know, it's a real pain doing this mod just as everyone starts having issues,lol

I have it all installed, but I'm not fully sure what should be happening now, I setup two paypal sandbox accounts, one for the store, one for a buyer.

Using the buyer account, I purchase at the store and go to checkout, I reach the paypal point(at this point OSC shows it as preparing) I pay,continue etc, now, buyers paypal shows as paid, shop paypal shows as received. transaction changes to pending? I'm guessing that's not correct? as it has cleared, should it not change to proccessing?

The thing that's really got me worried though, is that no emails are being sent out from OSC to me saying you have an order or you need to check someting, is that normal? even when I set up on the live server using $0.01 purchase and a friend pays real money.I get no indication that a purchase has been made? can someone point out anything I need to check please, I'm tired of these late nights,lol I just want it to go live.

I posted early this morning about a problem with catalog/admin/orders.php (line 173)

not seen a reply yet but just wonder if that has anything to do with this problem.

 

I only installed last night and I have already had some orders with live payments so getting the money is not the problem.

 

There are somethings I do not understand (well must of them really) about what is surposed to happen.

 

Is there something that should be set up at paypl to allow them to let you know that an order has been paid for?

If so what and how?

Step by step guide please as I know nothing.

 

Should I be geting E-mails from my shop that tells me that an order has been placed?

My customers get e-mails confirming there order but I so far have had nothing!

 

Finaly my other post about catalog/admin/orders.php (line 173)

on page 66 of this topic.

 

Can someone who knows, I sure don't, help out here and maybe let me know what i have done wrong. Its the only part of the mod that I have found that makes something else not work. I am sure it will be something the these with some knowledge can pick out in a second.

 

Please. (I would say Pretty Please but i cna't spell it! :D )

Edited by SteveDB
Link to comment
Share on other sites

Make that Three! I have the same issue, no Paypal IPN info inserted in the order, shows Pending, Paypal account shows the transaction OK.  I have made NO site changes in the time frame of this starting to happen, so I'm wondering if Paypal made a code change?

OK, and now it's working. I did nothing, so I am assuming that Paypal had issues that are now resolved, or being resolved, either way it is working fine. Received IPN info into cart admin and the usual Order confirm emails. Who knows? (Betcha Paypal does <_< ).

Link to comment
Share on other sites

I have been using this contrib since a long time now. I haven't faced any problem, but today one of my customers paid the amount and I got the confirmation from Paypal, but didn't get any notification from my store (generally I get 2). Moreover the status of the order didn't change to "Processing" from "Pending". Last thing I modified was Ultimate SEO URLs and Guest Reviews. I don't think they have created any problem, but can someone let me know what file(s) or segment of code responsible for updating the order status and sending the emails to the admin.

 

As far as I can tell this seems to be an intermittent problem with paypal either not sending the return IPN or their being a connection problem the prevents the IPN from arrivng. It doesn't just happen with this module, I've had it happen with another paypal IPN module as well.

Edited by lane
Link to comment
Share on other sites

At this rate I'm going to have to use it as is. That means my customers and myself will not receive an order process email. However the customer will get a Pay Pal receipt that is itemized (better than nothing?) and I can login to the admin and send them an email saying it's processing. Do you all think that would be ok?

Link to comment
Share on other sites

Thanks for the replies. So, I'll too assume that it has to do smthng with Paypal's temporary problems and would wait for my next order or myself place a fake order.

 

But can someone help me with my second question (quoted below)

 

Thanks

 

I also have another question, when I provide Gift Vouchers or Discount Coupons to my customers and sometimes they are 10 - 15 cents less than the order's total. I manualy change the order's status to "Processing" (which is fine with me), but the problem is that, the item(s) sold are not listed in the best sellers.

 

I would really appreciate if someone can help me with these problems. Thanks in advance.

Link to comment
Share on other sites

Made a request few days ago for help with a setup problem and have not seen a reply. Throught I might start to beg but if I get out of the wheelchair I wont be able to see a reply.

 

The problem is when I do one of the mods in catalog/admin/orders.php (line 173)

It has an bad effect on Customer orders. to see full details I put a link to my first post.

http://www.oscommerce.com/forums/index.php?sho...ndpost&p=536453

 

If someone who understands these things could get back to me it would be a help.

Thank you :D

Link to comment
Share on other sites

Same problem here. After a year of smooth payment processing, suddenly our membership site is only receiving intermittent PayPal IPN notification. We receive the email notification. It appeared to resolve yesterday but the problem began again today. I've emailed PayPal in hopes of finding a solution (or cause).

Link to comment
Share on other sites

I am also receiving intermittent  ipn notifications, sometimes it takes a day to receive the notification.  Worked smoothly for months.

 

 

I believe Paypal is upto something, they are changing stuff, or may be its just some problem at their end. So far my transactions are sending all the emails.

 

So, probably, the Paypal IPN does that at certain times only.

Link to comment
Share on other sites

Hi, I have always my problem under Paypal_Shipping_Cart V3.0a

 

When I do a payment on my site by paypal:

 

- it sends me well on the page of paypal

- it wonders me to choose if I have an account or if I pay by credit card

- once the payment does, it wonders me to click on "to return to my shop"

- it returns well on my shop, the confirmation page checkout_succes appears well

- the order appears in my admin panel in "orders" but no paypal transaction into it

- the order is therefore "pending"

- the customer receives the email confirmation of paypal, but not the one of my shop

- in "paypal IPN", the transaction appears in "credit"

 

Brief, after several the whole community FR of paypal and osc, we are always blocked.

 

- we tried the test mode, not any change, the test is ok... but always the bug

- passed all osc in US rather than in FR and always the bug

- put the devise in USD rather than in EUR and we have always the bug

- forced the site to go through paypal US and not paypal FR, always the bug

- we open an account in US (and not FR), always a bug

 

We completely jammed... have you an idea ?

 

Thank-you in advance.

Link to comment
Share on other sites

Hi, I have always my problem under Paypal_Shipping_Cart V3.0a

 

When I do a payment on my site by paypal:

 

- it sends me well on the page of paypal

- it wonders me to choose if I have an account or if I pay by credit card

- once the payment does, it wonders me to click on "to return to my shop"

- it returns well on my shop, the confirmation page checkout_succes appears well

- the order appears in my admin panel in "orders" but no paypal transaction into it

- the order is therefore "pending"

- the customer receives the email confirmation of paypal, but not the one of my shop

- in "paypal IPN", the transaction appears in "credit"

 

Brief, after several the whole community FR of paypal and osc, we are always blocked.

 

- we tried the test mode, not any change, the test is ok... but always the bug

- passed all osc in US rather than in FR and always the bug

- put the devise in USD rather than in EUR and we have always the bug

- forced the site to go through paypal US and not paypal FR, always the bug

- we open an account in US (and not FR), always a bug

 

We completely jammed... have you an idea ?

 

Thank-you in advance.

 

 

Hello I have exactly the same problem as it and I do not know how to make.

IEUFLR2000

Link to comment
Share on other sites

Well, you don't really give much to go on. I cannot quite understand what the problem is. The bug is not explained.

 

Was it previously working?

If so, and you have made no changes, it mut be PayPal. I had earlier problems with PayPal that made me think that their site was having problems.

 

Have you made any changes to your OsC installation?

If so, look there.

 

I thought that the order was pending until the CC transaction was verified.

 

Are your settings in PayPal correct? Check these against the install instructions.

 

Have you read PayPals updated Policies?

 

Do you have access to paypal?

Mine was off for several hours on the weekend because my isp could not access inernational (from Australia) sites. There has been no explanation of what the problem was, but I could not get out of Australia. I could not even check this forum. Have you checked this? Can you do a google search?

 

PayPal do not seem to be User friendly. Check out alternative options for your country.

Link to comment
Share on other sites

Do you have access to paypal?

Mine was off for several hours on the weekend because my isp could not access inernational (from Australia) sites. There has been no explanation of what the problem was, but I could not get out of Australia. I could not even check this forum. Have you checked this? Can you do a google search?

 

PayPal do not seem to be User friendly. Check out alternative options for your country.

 

This outage was optus related, thus, would not relate to the two gentlemen above.

Link to comment
Share on other sites

It seems to me that this is becoming a common problem for people, order status not changing. I've never been able to get a test to work or an actual transaction to work with this Pay Pal module and I'm not alone.

Hi Sammy

 

Yes it was Optus related, but they could not get out of Australia and they use (I think) a third party connection to the outside world. Run a tracert to your destination www address to confirm that it is not your isp (as distinct, in my case, to my web host). Anyway, Optus has not replied to my e-mail and I only use them as my ISP because they are the only option available to tome to get a cable internet connection. The information about Optus was made for information purposes only and I do not know if people o/s were having a similar problem. I was having problems connecting to PayPal prior to the optus outage. I was merely trying to share some of my telephony experience that is related to fault finding.

 

With that said, are you using the test ipn in admin?

 

I have said before in, this and other forums, not to use the sandbox to test.

 

Don't know about order status staus not changing (still waiting for an OsC order via PayPal). However, my tests via the test ipn in admin meet my expectations. My understanding is that the order staus will not change until you get the confirmation from Paypal. One test that I did failed because the CC that I put in was invalid, others (via sandbox) failed because I cannot pay myself.

 

Other people have said that they had problems and the problem rectified itself. If changes have not ben made to OsC, then the problems could their web host or PayPal.

 

If you want me (not a programmer) to look at your file, then send a PM.

Link to comment
Share on other sites

Congratulations.

 

This is the first IPN module i have installed that actually says what it does.

Worked first time and is wicked.....

 

I do have a challenge though.

 

My order confirmation emails that get sent out have a promotion at the top. Problem is when you pay by paypal it uses a different file to generate the email.

 

Order.class.php.

 

Is there any way of putting the hooks in for this contribution.

http://www.oscommerce.com/community/contri...rch,email+extra

 

I have had a go but i am not very good on mysql or php for that matter....

 

Thanks in advance, Im sure other people would use the hooks.

Link to comment
Share on other sites

I need help ASAP!

 

I'm using the latest version 3.0a.

 

I have everything working fine but the PayPal_Shopping_Cart_IPN is now adding tax wrong.

 

For instance, The total I have is:

 

Item = $100

Shipping = $10

GST 7% + PST 8% = $15

GST on shipping + PST on shipping = $1.50

Total = $126.50

 

 

When the buyer checks out the PayPal_Shopping_Cart_IPN only adds the following:

 

Item = $100

Shipping = $10

GST 7% + PST 8% = $15

Total = $125.00

 

 

So basically it doesn't include the tax on shipping.

 

I have two tax classess I'm using one for the total and one for shipping, the tax on shipping is not being sent to paypal.

 

How can I fix this?

Link to comment
Share on other sites

OK If I change fro "Itemized" to "aggregate" in the options the totals match up, but this sucks because I want the items to show up in the buyers account and mine. I want itemized.

 

SO I think the problem lies here.

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