Jump to content
Sign in to follow this  
devosc

[Contribution]Paypal IPN - 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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Guest

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?

Share this post


Link to post
Share on other sites
Guest

Nevermind - fixed it...

Share this post


Link to post
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.

Need Help? See this thread and provide the information requested.

How to Upgrade to the latest version

Recommended SEO Addons

Share this post


Link to post
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.

Share this post


Link to post
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://forums.oscommerce.com/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?

Share this post


Link to post
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....

Share this post


Link to post
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.

Share this post


Link to post
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:

Share this post


Link to post
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).

Share this post


Link to post
Share on other sites
Guest
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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)

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Quick question - for the last few days orders paid for with Pay Pal are no longer including the address in the order emails - has something changed because it was working fine before?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Guest

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?

Share this post


Link to post
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

Share this post


Link to post
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.

Need Help? See this thread and provide the information requested.

How to Upgrade to the latest version

Recommended SEO Addons

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Any clues on why the address is no longer being sent out with order emails?

 

Hmm..... does Greg have me on ignore?!

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  

×