Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

Hi Greg,

Thanks for the reply ...I still can't find the text "or" just before the paypal logo on the Payment Information page....No big problem for now...

 

 

This is a great contribution and in general is working straight away for me! =)

 

I do have one small issue that when an order is placed neither the customer or me recieves an email from OSC.

 

In the order details there is a big red cross next to the "Customer Notified" field.

 

Could anyone tell me why this is?

 

very good contrib, thanks!

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

Hi profpixel,

 

The 'or' is hardcoded in includes/modules/payment/paypal.php on line 85.

 

When the order is first placed, e.g the customer clicks the osC checkout confirmation button and is then transferred to PayPal, then at this stage although the order is pre-stored nobody is notified hence a red cross appears in the admin order history.

Once the customer has paid and their payment has cleared PayPal will then send you an official payment receipt and also send an IPN with a 'Completed' payment status which upon receiving and successfully validating will then update the store's inventory levels and the customer is only then notified at that time(and you).

In between confirming an order and the customer receiving their osC order confirmation, they can view their account history info and view the details of that transaction.

If you've decided to synchronize invoices with PayPal, then in the customers account history info for that particular order an 'order confirmation' button will appear, which they can click, if they have previously successfully paid for that order PayPal will prevent them from paying again, however if for some reason they did not previously complete their payment by clicking on the account_history_info.order_confirmation button they can then resume payment for that particular transaction.

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

Link to comment
Share on other sites

I don't know if this is the right thread for this, but I tried installing paypal_ipn, and it gave me an error in the admin/filename.php file. Figuring I missed something and not having the time at the moment to check through all the edits, I tried to reboot the store and database with my backup of the orginal unmodded store. Now I'm getting a "Parse error: parse error, unexpected T_VARIABLE in /home/public_html/store/admin/includes/functions/general.php on line 2" error in the admin of the store... any ideas how to fix that?

 

Looking back, I realize one mistake I probably made was I forgot to uninstall paypal at the get-go... would that effect either the filename.php or the current error I'm getting?

Link to comment
Share on other sites

I don't know how I missed this but I just discovered that the New Order emails sent out do not contain the products when an order is placed using this mod. It appears as

Products

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

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

Everything else in the email is fine, the products are just not listed. Has anyone seen this or can you tell me where this email is generated so I can troubleshoot it myself?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Smoker,

 

Download phpMyAdmin via this link, it is the 'zip' version. Unzip it and in the main directory look for config.inc.php

In that script modify the following fields (exmples below where appriopiate):

$cfg['PmaAbsoluteUri'] = 'http://www.mydomain.com/phpMyAdmin/';

$cfg['blowfish_secret'] = 'Secret_PassPhrase';

$cfg['Servers'][$i]['host'] ? ? ? ? ?= 'localhost'; // MySQL hostname or IP address

$cfg['Servers'][$i]['auth_type'] ? ? = 'cookie'; ? ?// Authentication method (config, http or cookie based)?

$cfg['Servers'][$i]['user'] ? ? ? ? ?= 'UserName'; ? ? ?// MySQL user

$cfg['Servers'][$i]['password'] ? ? ?= 'UserName_Password'; ? // MySQL password (only needed

Sorry to be a bother but I still am havings problems getting phpMyAdmin to work.

I am assuming I must enter some of my own info when I replace the lines of code given. If so in which ones. My store is hosted by a server that I can not make changes to. Can I use phpmyadmin on my PC at work/home to install IPN. Any help someone could give would be much appreciated.

Link to comment
Share on other sites

Stock quantity value not being updated

 

I've installed PayPal_Shopping_Cart_IPN_v2.6a. I'm testing with Sandbox. My inventory/stock values are not being updated (decremented) in the database on the completion of a sale. I see that at least one or more others have mentioned the same problem in this thread::

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

 

(sorry if it's been answered somewhere - it's such a huge thread and it seems it's not possible to search within a specific thread).

 

Sandbox.paypal.com payment process seems to go well. "Buyer" is debited and sent an email. "Seller" gets the money in the account and receives an email. osCommerce get all the right order info (processing, item name, quantity, total, etc) but the available stock value doesnt' get updated to reflect the sale. It just keeps the value first manually entred.

 

I have debugging on and I'm collecting debug reports via email.

 

Any suggestions as to what the problem is?

Link to comment
Share on other sites

The PayPal payment option does not appear when it is installed.

 

* I've just noticed, I think only for this version, that before the PayPal payment option appears on the checkout payment page, you must first edit and click update via admin->modules->payment->paypal, I'll look into it more later on....

 

The paypal option does not appear... and ive tried updating....

Link to comment
Share on other sites

Stock quantity value not being updated

I *think* I found the source of the problem (I found something buried in a post somewhere).

 

In the Admin-->payment models-->paypal settings, I had to turn off the Cart Test option. Doing so allows the stock to update properly on a sale.

 

Hopefully this helps others who are having same problem. It might be worth adding this note to the installation instruction that come with the downlaod.

Link to comment
Share on other sites

Hi

I would like to know this contrib is for the business account or personal account.

 

1. Can personal account work for this contrib.

2. What about the business account? Can this contrib be able to handle credit cards?

 

Thanks in advance. :lol:

Link to comment
Share on other sites

Hi

I would like to know this contrib is for the business account or personal account.

 

1. Can personal account work for this contrib.

2. What about the business account? Can this contrib be able to handle credit cards?

 

Thanks in advance. :lol:

A personal paypal account does not allow accepting payments via credit card. You must have a business account. So, that answers your first question.

 

Once you have a business account with paypal, then yes, this contribution works very well. Import the SQL tables into your database as described in the instructions, include the modified files (make sure to the proper read/write permissions are on those files) and things should work.

 

(note:) I simply copied the modified files from the supplied download and copied over the originals (I have a backup of course).

Link to comment
Share on other sites

A personal paypal account does not allow accepting payments via credit card. You must have a business account. So, that answers your first question.

A premier account (the level in between personal and business) is sufficient for accepting credit cards.

Link to comment
Share on other sites

I installed this contrib last night with no problem at all. However, this morning I was alerted by a customer that PayPal was trying to charge the SUBTOTAL amount and not the TOTAL amount. After changing the Order Total display order, and then changing them back, and then making sure I had everything setup correctly with PayPal, I finally found the solution: change Itemized to Aggregate.

 

However, here is the new problem. This morning, I was receiving IPNs from PayPal and things were working the way they should, except the Subtotal issue above. Now, I am not receiving any IPNs and the orders are remaining in the "incomplete" order status, although payment has bene made and I do receive the "notification of payment" from PayPal.

 

Is this simply because I changed from Itemized to Aggregate? Is there something I need to change in PayPal? How do I test this without having to use a live account/transactions?

 

Thanks!

Priest

Edited by Priest
Link to comment
Share on other sites

UPDATE:

I signed up for a "Developer Account" at Sandbox and then tried placing orders. I tried placing orders both with the Test/Cart mode turned ON and also with it turned OFF.

 

Each time after payment was made, I would be directed to a "You Made a Payment" page with a link at the bottom reading: "Click here to continue." Once clicked, I was taken to the checkout_success page on my site.

 

First off, why was I taken to the "You Made a Payment" page and not directly back to my site? I have turned on auto-return in PayPal. Secondly, even though I clicked the link and returned to checkout_success, the orders placed still remained in the "incomplete" order status.

 

Anyone have any ideas what is happening? I also tried both Itemized and Aggregated and still the same response. IPN was working this morning. ARG! :angry:

 

Thanks,

Priest

Link to comment
Share on other sites

I think I have found a bug within the paypal ipn code in conjunction with osc-affiliate. First let me say I am running 2.4 of the paypal code so if this is fixed then I apologize for taking up space within the posts.

 

bug#1

In the code block stated within the misc/affiliate.txt file

 

//in paypal/checkout_update.php

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

BEFORE (approx line 102):

// update the order's status

ADD:

  if (tep_not_null($affiliate_ref)) {

    define('MODULE_PAYMENT_PAYPAL_SHOPPING_IPN_AFFILIATE','True');

 

$affiliate_ref will never be null because it is defined as not null default '' within the database alter statements

 

ALTER TABLE orders_session_info ADD affiliate_id int(11) NOT NULL default '';

 

this causes the variable to become 0 based on the int(11) declaration. Since neither the paypal code nor the affiliate code checks for ref = 0, each time the store processes a paypal payment, affiliate 0 gets a sale. there is no affiliate 0.

 

My suggestion is to test for not_null and not 0 in the if line of the code frag above.

 

bug #2 this might not be a bug...

In playing/debugging the above example I came across something funny on a clients site. As we know if there is no ipn information it usually means the customer went to paypal then abandoned the sale for some reason.... but last night I came across a clients customer that had no ipn information but the client had an email from paypal that said the customer paid.... has anyone else run across this? I can see scenarios where this could happen, the customer quits paypal before paying then comes back to paypal and makes a payment to the store etc ... but not for sure if this was the case yet..... Will try to find out more information...

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

Link to comment
Share on other sites

Priest, may sound silly but have you configured your primary and business id for the sandbox correctly.

Generally 'aggregate' should not cause any problems especially if using other order_total module contribs.

 

Strider, if i can recall correctly, a new introduction in 2.6 was that when PayPal themselves respond with an 'invalid' ipn response 2.6 will output Error 500 error headers, this will cause PayPal to resend the IPN - this is because PayPal themselves can sometimes incorrectly invalidate an authentic transaction.

This introduction is implemented in the function 'dienice' in the paypal/ipn.php class (note reference to old naming concept - now paypal/classes/ipn.class.php).

 

At some point I would like to introduce usage of PayPal's web services whereby for each transaction one can then actually click and confirm (visual comparison) the PayPal transaction details from the osC admin, e.g they don't need to login to PayPal but this requires a slightly more advanced PayPal config.

 

Thanks for pointing out the error in the osC-Affiliate integration.

 

Out of interest did you make any additional changes to the paypal/checkout_process.php or paypal/checkout_update.php scripts for ccgv?

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

Link to comment
Share on other sites

Well, I received ONE order last night where IPN worked. But this morning, I woke up to see that I received TWO more orders which were paid for but IPN did not work, but were paid for. In both of these cases, customers still had the items in their cart. So I had to manually change the order status and clear their cart.

 

This may sound crazy but I believe that despite the fact that I have Auto-Return set to ON, PayPal is not automatically redirecting back to my site. When I tested, I kept being directed to the "You've Made a Payment" page after making a payment. But when I created a test business account and set everything up the same in Sandbox, it redirected as supposed to do.

 

I think that customers just are NOT clicking the "Click here to continue" link. And PayPal isn't auto-returning to my site.

 

What would cause this?

 

Also, I only have ONE email address associated with my business PayPal account. And I have used that email address as both the primary and business ID. I don't believe now that "aggregate" had anything to do with the problems.

 

Thanks,

Priest

Edited by Priest
Link to comment
Share on other sites

Hi all,

I've got this contribution installed, along with CCGV contrib. I've noticed that I've got to configure the paypal module to use aggregate totals rather than itemized if I want the discounts from the vouchers to apply.

 

Has anyone else come across this, and has anyone managed to get it working with itemized payments?

 

Thanks,

Simon

Link to comment
Share on other sites

Hi everyone, Did something happen with Paypal? I was getting my IPN notifications just fine until yesterday. Like Priest Im not getting the IPN anymore. I have version 2.6a installed. I get emails from paypal that the transaction has been completed and the money is there in my account, however the orders remain as pending with no IPN's.Is anyone else seeing this problem also?

Link to comment
Share on other sites

Preist, you do have either a premier or business PayPal account?

 

I just tried a live transaction and didn't have any problems with auto return and also the cusotmer's PayPal 'verified' shipping address details were returned.

 

However this might also be dependent on your locale.

 

Will and try and look into more....

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

Link to comment
Share on other sites

Gregory - I posted a question a few pages back about the products not showing up in the email. Do you have any idea what would be causing this or where I can look to troubleshoot it?

 

jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Preist, you do have either a premier or business PayPal account?

 

I just tried a live transaction and didn't have any problems with auto return and also the cusotmer's PayPal 'verified' shipping address details were returned.

 

However this might also be dependent on your locale.

 

Will and try and look into more....

Well, I just got 3 orders that IPN DID work and 4 that is did not work. I can't tell for sure since I only have one PayPal account (Business) and can't do a live transaction but I am quite sure that my auto-return is not working, and that is causing the problem, because people are not clicking the "Click here to continue" link.

 

I would rather the auto-return work.

 

If there is a way you could check out my system to see if it's working, PM me and I will give you the details and we can check it out. I don't want t make a big deal out of this if it's just a system setting but I am checked everything and it is still happening.

 

Thanks,

Priest

Link to comment
Share on other sites

Jack, the only thing I can suggest at present is paypal/catalog/checkout_update.inc.php this is where the stock inventory is updated and the order email sent, which if the customer address details are correctly being included correctly seems weird that the products are not being dealt with accordingly.

 

Priest, even the customer did click the PayPal.continue button the only thing that happens is their cart is reset, e.g the order is not updated, it is now only the ipn that generates/completes the order.

 

As a side note to all, PayPal currently has a problem when you have configured in your PayPal profile to switch on PDT (payment data transfer) AND Credit Cards, upon completion the customer is not being correctly returned to the site so their cart is not immediately reset.

This contrib does not use PDT, this may be introduced in MS3 because MS3's database class is better scripted and can more easily suppress errors.

However in the meantime :blink: Credit Card payments will still work it is just that the customers cart is not immediately reset upon their return.

PayPal are aware of the situation.

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

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