Post by Qphoria » Wed Jul 28, 2010 10:05 am

This is the announcement thread for the Latest fixes to the Paypal Standard Extension that comes with Paypal. The version here should be the same or NEWER than the latest version of OpenCart.

This version will work with 1.4.8 through 1.4.9.4. 1.4.9.5-1.4.9.6 already have this fix.

The current version is NEWER than the one in v1.4.9.4
DO NOT USE if using an OpenCart version newer than v1.4.9.4 as it likely has this change and additional changes

Read the Paypal Configuration Documentation for info on how to setup your Paypal Account the preferred way.

New features:
- Itemized product list with options support
- Support for Discounts, Taxes, Shipping. Even coupons with itemized mode works correctly now
- PDT Support for browser-side validation (backup protection if IPN isn't working)
- Some new methods for IPN verification
- Multiple status support for different paypal states with automatic update for changes via ipn. (echeck, refund, dispute, etc)
- Many additional validation steps to cut down on scammers (price match, email match, referrer, etc)
- IPN and PDT work together for additional security and reliability
- Supported currency check (Paypal supports 18 currencies). If using a non-supported currency, it converts to USD.

Image
Image

Other Features:
There are numerous debug points in the code. Considering how many people have problems with paypal, not only in opencart, but everywhere, I figured it would be best to log as much as possible when the debug mode is enabled. You can see debug messages in the OpenCart System log.
Image

There are validation checks in place for security reasons. Some crafty people know how to fake the ipn callback with the old version, allowing them to change the price for a $50 piece of software and change it to 0.10 and trick the system. Now I have added additional checks
- Reciever email matches the opencart paypal email.
- Additional ones can be added easily to the validate function to do postcode checks, etc.

The script will also send out alert emails if any of the following occur:
- Validation failure (price mismatch, wrong email, etc)
- Unsolicited Status changes (from disputes, refunds, etc)
- Any order that doesn't end up in the 'Completed' state after IPN has been received

The comments will also log the status of the order after IPN has been received.

PDT and IPN are both fully supported in this version. IPN is triggered in the background, PDT is triggered when you click "Return to merchant" on the paypal site. Both callbacks will do validation checks and update the order in case the other one doesn't. They are designed to back eachother up so that orders are more reliably stored and validated.

TIPS & NOTES
- IF YOU ARE NOT SEEING IPN MESSAGES IN THE SYSTEM LOG WHEN DEBUG MODE IS ENABLED, THEN YOUR SITE IS NOT RECEIVING THEM. CHECK YOUR SERVER LOGS AND THE PAYPAL IPN HISTORY TO GET MORE INFORMATION.
- IF YOU ARE TESTING ON A LOCALHOST, YOU WILL NOT SEE IPN MESSAGES BECAUSE THEY CAN'T BE SENT TO A LOCALHOST. HOWEVER, PDT WILL STILL WORK WHEN YOU CLICK "RETURN TO MERCHANT"
- ENABLE PDT IN YOUR PAYPAL ACCOUNT. IT IS NOT REQUIRED, BUT RECOMMENDED. Google "Paypal PDT" for more help
- YOU CAN USE AUTO-RETURN IN YOUR PAYPAL ACCOUNT AND IT IS RECOMMENDED
- FOR THE PAYPAL IPN URL IN YOUR PAYPAL ACCOUNT, USE ANY URL. EVEN GOOGLE.COM. IT WILL BE OVERRIDDEN BY THE SCRIPT.
- THIS VERSION ONLY USES CURL BECAUSE FSOCK IS BEING SUPPORTED LESS OFTEN. YOU MUST HAVE CURL ON YOUR SERVER. 99% OF HOSTS USE CURL. IF YOUR HOST DOESN'T HAVE CURL INSTALLED, FIND A NEW HOST.

Known Issues
- The same old problem of certain IPN responses being INVALID due to strange characters in the address or name field still plagues me. I find many people on the paypal developer forums with the same issue, but they all seem to have a different idea to make it work, but none of them are 100%. So if you have a name on your paypal address with an apostrophe or some other non-normal character, You will likely see IPN INVALID in the system log. However, the order will be changed to "Pending" state for manual verification. So no orders will be lost

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by OC2PS » Wed Jul 28, 2010 11:32 pm

Q, the screenshots and feature explanation is awesome. I'll surely download and test it this week.

OC2PS
OC 3.0.3.7, vQmod 2.6.2, Journal3 theme
Arcfesték, Csillámtetoválás, Henna
Image
Check out: All my extensions | My FREE extensions


User avatar
Active Member

Posts

Joined
Wed Jul 22, 2009 4:15 am
Location - Hungary

Post by JAY6390 » Wed Jul 28, 2010 11:44 pm

One quick thing I've noticed, and not sure if it's a bug or just the way paypal handles it, but when I order something like this
- SNIP -
The paid items show the quantities, but the free ones do not. PayPal still knows the cart has 4 items still however (if you minimise the breakdown)
- SNIP - so not really sure on this

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Qphoria » Wed Jul 28, 2010 11:54 pm

Paypal just doesn't handle 0.00 priced items so they remove it from their calculations. Just one of those paypal nuances

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JAY6390 » Thu Jul 29, 2010 12:53 am

Thats what I thought, good to know :)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Chrissy Poo » Mon Aug 02, 2010 9:20 pm

Thanks for this, I have it all setup and working great.

Just out of interest is there any way to disable/stop the "ATTN: Paypal Order needs manual verification" emails? I have had 2 orders and the amounts are correct, also I always check orders against Paypal before shipping.

Hoping I just need to comment out a bit of code or something :)

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by JAY6390 » Wed Aug 04, 2010 7:14 am

I've had payments without issue so far (AFAIK) :)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Qphoria » Wed Aug 11, 2010 10:34 pm

"Paypal Account Optional"
This setting is only available to premier or business accounts. To make your account premier or business, you simply have to have a credit card and bank account on file with paypal. This then gives your customers who have never used paypal to see the credit card payment option on the paypal site. It is not required for the mod, just recommended

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Jghelectronics » Fri Aug 13, 2010 4:18 am

Hi, Great upgrade, I installed it and its working fine.

User avatar

Posts

Joined
Thu Aug 12, 2010 6:53 am
Location - Cayman Islands

Post by zerojinx » Thu Aug 19, 2010 12:19 pm

So got the patch installed and almost everything is working fine, set up ipn and pdt and orders show up in dashboard.

orders will pop up as pending, but show the comment "completed". I can not get the order to go to completed without manually doing it. when refunded, it shows up as refunded.

thanks for the update, everything else is showing up fine!

Michael Bielaczyc
http://www.aradanicostumes.com
http://www.aradani.com


New member

Posts

Joined
Fri May 07, 2010 11:17 am

Post by zerojinx » Tue Aug 24, 2010 7:29 am

From the error log :

Code: Select all

2010-08-23 23:23:33 - PP_STANDARD :: IPN INIT <-- DEBUG POST VARS::mc_gross=9.03&invoice=189 - Mike bielaczyc&protection_eligibility=Eligible&address_status=confirmed&item_number1=Spirit Gum&payer_id=PZR2HSBAYCC8G&tax=0.28&address_street=1112 Delmas Ave&payment_date=16:23:27 Aug 23, 2010 PDT&option_selection1_1=1/8 oz&payment_status=Completed&charset=windows-1252&address_zip=37216&mc_shipping=5.75&mc_handling=0.00&first_name=Michael&mc_fee=0.50&address_country_code=US&address_name=Michael Bielaczyc&notify_version=3.0&custom=Zmlr&payer_status=verified&business=sales@aradani.com&address_country=United States&num_cart_items=1&mc_handling1=0.00&address_city=Nashville&verify_sign=Ai1PaghZh5FmBLCDCTQpwG8jB264AIXhSePhqPUmJ6tPenx9NNYr.nGM&payer_email=mikepaypal@aradani.com&mc_shipping1=5.75&option_name1_1=Size&txn_id=8X24646082529845U&payment_type=instant&last_name=Bielaczyc&address_state=TN&item_name1=Spirit Gum&receiver_email=sales@aradani.com&payment_fee=0.50&quantity1=1&receiver_id=CZJ5XU325QL32&txn_type=cart&mc_gross_1=8.75&mc_currency=USD&residence_country=US&transaction_subject=Zmlr&payment_gross=9.03&
2010-08-23 23:23:33 - PP_STANDARD :: IPN REQ  --> cmd=_notify-validate&mc_gross=9.03&invoice=189+-+Mike+bielaczyc&protection_eligibility=Eligible&address_status=confirmed&item_number1=Spirit+Gum&payer_id=PZR2HSBAYCC8G&tax=0.28&address_street=1112+Delmas+Ave&payment_date=16%3A23%3A27+Aug+23%2C+2010+PDT&option_selection1_1=1%2F8+oz&payment_status=Completed&charset=windows-1252&address_zip=37216&mc_shipping=5.75&mc_handling=0.00&first_name=Michael&mc_fee=0.50&address_country_code=US&address_name=Michael+Bielaczyc&notify_version=3.0&custom=Zmlr&payer_status=verified&business=sales%40aradani.com&address_country=United+States&num_cart_items=1&mc_handling1=0.00&address_city=Nashville&verify_sign=Ai1PaghZh5FmBLCDCTQpwG8jB264AIXhSePhqPUmJ6tPenx9NNYr.nGM&payer_email=mikepaypal%40aradani.com&mc_shipping1=5.75&option_name1_1=Size&txn_id=8X24646082529845U&payment_type=instant&last_name=Bielaczyc&address_state=TN&item_name1=Spirit+Gum&receiver_email=sales%40aradani.com&payment_fee=0.50&quantity1=1&receiver_id=CZJ5XU325QL32&txn_type=cart&mc_gross_1=8.75&mc_currency=USD&residence_country=US&transaction_subject=Zmlr&payment_gross=9.03
2010-08-23 23:23:33 - PP_STANDARD :: IPN RESP <-- 
2010-08-23 23:23:33 - PHP Notice:  Undefined index:  HTTP_USER_AGENT in /home/aradani/public_html/aradanicostumes/catalog/view/theme/aradanitheme/template/common/header.tpl on line 1
2010-08-23 23:23:34 - PP_STANDARD :: PDT INIT <-- DEBUG GET VARS::route=payment/pp_standard/pdt&tx=8X24646082529845U&st=Completed&amt=9.03&cc=USD&cm=Zmlr&item_number=&

Michael Bielaczyc
http://www.aradanicostumes.com
http://www.aradani.com


New member

Posts

Joined
Fri May 07, 2010 11:17 am

Post by Qphoria » Thu Aug 26, 2010 9:30 pm

Your IPN response is coming back empty which would explain why it is not going completed.
IPN RESP <--

From the log, I don't see PDT enabled. I see the init.. but if it was enabled, it would have a PDT REQ and PDT RESP as well like IPN

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Brook » Fri Aug 27, 2010 11:06 am

Looking forward to v149 Final... Thank you for all the hard work. OpenCart is getting better and better.

Just so I understand...Once I have upgraded from v149 RC3 to v149 Final, do I need to install the latest PayPal Standard v149 Module on top of the v149 Final upgrade? or is PayPal Standard v149 Module already part of the v149 Final Upgrade?

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by Qphoria » Fri Aug 27, 2010 12:14 pm

Qphoria wrote: This is already in the core as of v1.4.9 so do not overwrite the core with this version if using v1.4.9 or later.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by MattW » Sat Aug 28, 2010 2:35 pm

Qphoria wrote:Your IPN response is coming back empty which would explain why it is not going completed.
IPN RESP <--

From the log, I don't see PDT enabled. I see the init.. but if it was enabled, it would have a PDT REQ and PDT RESP as well like IPN
I'm getting exactly the same responses on both sites I've just set up. Both have PDT enabled in PayPal, and the PDT Token is completed in the Payment module.

Code: Select all

2010-08-28 6:04:31 - PP_STANDARD :: IPN INIT <-- DEBUG POST VARS::mc_gross=2.00&invoice=9 - Michael Webb&protection_eligibility=Partially Eligible - INR Only&address_status=unconfirmed&item_number1=Sticker&payer_id=CA2Q2PFYSD28S&tax=0.00&address_street=Apartment 11, Queens Mews
86 Park Grange Road&payment_date=23:04:27 Aug 27, 2010 PDT&payment_status=Completed&charset=windows-1252&address_zip=S2 3RX&mc_shipping=0.00&mc_handling=0.00&first_name=Michael&mc_fee=0.27&address_country_code=GB&address_name=Michael Webb&notify_version=3.0&custom=bg==&payer_status=unverified&business=payments@z22se.co.uk&address_country=United Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=Sheffield&verify_sign=AQU0e5vuZCvSg-XJploSa.sGUDlpAoIY0UqadpJZwqP.FKyGeOpM6NjW&payer_email=bugeyedboy@hotmail.com&mc_shipping1=0.00&txn_id=2MV69145PK1789604&payment_type=instant&last_name=Webb&address_state=&item_name1=Sticker&receiver_email=payments@z22se.co.uk&payment_fee=&quantity1=1&receiver_id=X4A8G62XPTLFS&txn_type=cart&mc_gross_1=2.00&mc_currency=GBP&residence_country=GB&transaction_subject=bg==&payment_gross=&
2010-08-28 6:04:31 - PP_STANDARD :: IPN REQ  --> cmd=_notify-validate&mc_gross=2.00&invoice=9+-+Michael+Webb&protection_eligibility=Partially+Eligible+-+INR+Only&address_status=unconfirmed&item_number1=Sticker&payer_id=CA2Q2PFYSD28S&tax=0.00&address_street=Apartment+11%2C+Queens+Mews%0D%0A86+Park+Grange+Road&payment_date=23%3A04%3A27+Aug+27%2C+2010+PDT&payment_status=Completed&charset=windows-1252&address_zip=S2+3RX&mc_shipping=0.00&mc_handling=0.00&first_name=Michael&mc_fee=0.27&address_country_code=GB&address_name=Michael+Webb&notify_version=3.0&custom=bg%3D%3D&payer_status=unverified&business=payments%40z22se.co.uk&address_country=United+Kingdom&num_cart_items=1&mc_handling1=0.00&address_city=Sheffield&verify_sign=AQU0e5vuZCvSg-XJploSa.sGUDlpAoIY0UqadpJZwqP.FKyGeOpM6NjW&payer_email=bugeyedboy%40hotmail.com&mc_shipping1=0.00&txn_id=2MV69145PK1789604&payment_type=instant&last_name=Webb&address_state=&item_name1=Sticker&receiver_email=payments%40z22se.co.uk&payment_fee=&quantity1=1&receiver_id=X4A8G62XPTLFS&txn_type=cart&mc_gross_1=2.00&mc_currency=GBP&residence_country=GB&transaction_subject=bg%3D%3D&payment_gross=
2010-08-28 6:04:31 - PP_STANDARD :: IPN RESP <-- 
2010-08-28 6:04:36 - PP_STANDARD :: PDT INIT <-- DEBUG GET VARS::route=payment/pp_standard/pdt&tx=2MV69145PK1789604&st=Completed&amt=2.00&cc=GBP&cm=bg==&item_number=&
p

Image


User avatar
New member

Posts

Joined
Sat Aug 28, 2010 11:37 am
Location - Sheffield

Post by jcr66 » Sun Aug 29, 2010 12:51 am

Hi
This my first post due to having managed to get buy by searching and viewing all relevant posts to help me put together my first e-commerce site so thank you to all the posters who without I wouldnt of been able to do it. But I am stuck on my last part of installing paypal standard? I just need to know where do I paste the following: Payment Data Tranfer Identity Token? I know I need to paste it in the OpenCart Paypal configuration area but I am unsure if to paste it into /public_html/admin/controller/payment pp_standard.php ? I hope you can be of assitance
Cheers
Jim

PS echecks are automatically and properly handled now, but if you really want to block them you can do? Is this also something that I would need to do?

Newbie

Posts

Joined
Sun Aug 29, 2010 12:33 am

Post by MattW » Sun Aug 29, 2010 2:40 am

jcr66 wrote:I just need to know where do I paste the following: Payment Data Tranfer Identity Token? I know I need to paste it in the OpenCart Paypal configuration area but I am unsure if to paste it into /public_html/admin/controller/payment pp_standard.php ?
I just pasted mine into the PayPal configuration page, didn't touch the php files.

Image


User avatar
New member

Posts

Joined
Sat Aug 28, 2010 11:37 am
Location - Sheffield

Post by Topher » Sun Aug 29, 2010 7:34 pm

I came across opencart the other day, I have installed a copy and attempting to get it to work the way I would like it to. It is really fantastic, but I do wish there was a free google analytics e-commerce module.

Anyway moving to other matters, I have installed 1.4..9 and paypal seems to work.

But I am getting this message, I have only tried one transaction but I got this attached to the invoice that was sent to me, and the buyer also has it attached to their email.
PP_Standard - Possible Scam: IPN/PDT Receiver Email does not match seller email. Order needs manual verification
I am just wondering what it means, and why it is happening. Does it just mean that I have another email attached to my paypal account? or another email account is the default one? or it is happening because of the buyers email address?

I don't want people after buying to freak out, and think that I am a scammer. Is there a way to remove this or at least adjust settings in paypal to see if I can do something to avoid getting that attached to the bottom?

Thanks heaps, this module is really quite slick so I appreciate all your work.

Newbie

Posts

Joined
Sun Aug 29, 2010 7:14 pm
Location - brisbane, Australia

Post by Qphoria » Sun Aug 29, 2010 10:22 pm

Topher wrote:
PP_Standard - Possible Scam: IPN/PDT Receiver Email does not match seller email. Order needs manual verification
I am just wondering what it means, and why it is happening. Does it just mean that I have another email attached to my paypal account? or another email account is the default one? or it is happening because of the buyers email address?
Yea, I kinda forgot that the buyer would see this as well. Basically this means the email that was being paid doesn't match the email in your paypal configuration. This would be in the case where a scammer could fake alter the payment form and put their paypal email into the receiver, and then pay themselves, but return back to your store with a successful payment message, tricking you into thinking he paid you. This was a recommended validation check on the paypal developer forums. I'm not sure how you are seeing it though unless you are really being scammed.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Topher » Tue Aug 31, 2010 6:20 pm

Qphoria wrote:
Topher wrote:
PP_Standard - Possible Scam: IPN/PDT Receiver Email does not match seller email. Order needs manual verification
Yea, I kinda forgot that the buyer would see this as well. Basically this means the email that was being paid doesn't match the email in your paypal configuration. .... This was a recommended validation check on the paypal developer forums. I'm not sure how you are seeing it though unless you are really being scammed.
I have two accounts attached to paypal, one is my private address the other is the business one. I have made my account a business account. On the Paypal page I typed in the business email address,which has been attached to paypal.

Could that be the reason it is appearing?

I used my parents paypal account to run a mock test, since people had said that the sandbox version doesn't really work that well.

It would be nice to be able to remove this error or adjust the wording. Especially if it shows after every transaction time. The last thing I want to happen is people to freak out after reading the words "possible scam"

EDIT: I got another email, this one is from my hosting place. well it comes from their servers.
I have copied and pasted, removed any information that looked somewhat import and confidential. Don't mind the product names, It is just a temporary thing at the moment to see how it all works.
ATTN: Paypal Order 2 needs manual verification
from u <removed>
sender-time Sent at 8:43 PM (GMT-06:00). Current time there: 4:44 AM. ✆
to <removed>
date Tue, Aug 31, 2010 at 8:43 PM
subject ATTN: Paypal Order 2 needs manual verification
mailed-by <removed>.swiftservers.info


PP_Standard - Possible Scam: IPN/PDT Receiver Email does not match seller email. Order needs manual verification

DEBUG POST VARS::invoice=2 - <removed>
first_name=<removed>
mc_shipping=0.00
mc_currency=AUD
payer_status=verified
address_status=unconfirmed
payment_gross=
address_zip=<removed>
address_country_code=AU
mc_handling=0.00
txn_type=cart
num_cart_items=6
verify_sign=<removed>
payer_id=N<removed>
option_selection2_1=No Extras
option_selection2_2=Screw Driver Set
option_selection2_3=Adhesive
charset=windows-1252
option_selection2_4=No Extras
option_selection2_5=No Extras
auth_id=<removed>
option_selection2_6=Screw Driver Set
transaction_entity=auth
receiver_id=<removed>
mc_handling1=0.00
mc_handling2=0.00
mc_handling3=0.00
mc_handling4=0.00
mc_handling5=0.00
tax=0.48
mc_handling6=0.00
item_name1=Another Example Producks
item_name2=Another Example Producks
item_name3=Another Example Producks
item_name4=Another Example Producks
payment_type=instant
item_name5=Another Example Producks
item_name6=Another Example Producks
address_street=<removed>
mc_shipping1=0.00
mc_shipping2=0.00
mc_shipping3=0.00
txn_id=<removed>
mc_shipping4=0.00
mc_shipping5=0.00
mc_shipping6=0.00
mc_gross_1=0.25
quantity1=1
mc_gross_2=0.50
quantity2=1
item_number1=Not an iPhone
protection_eligibility=Ineligible
mc_gross_3=0.45
quantity3=1
item_number2=Not an iPhone
mc_gross_4=0.35
quantity4=1
item_number3=Not an iPhone
custom=Zw==
mc_gross_5=0.45
quantity5=3
item_number4=Not an iPhone
mc_gross_6=0.40
quantity6=1
option_selection1_1=Super High Copy
item_number5=Not an iPhone
item_number6=Not an iPhone
option_selection1_2=Original
business=<removed> Business email
option_selection1_3=Original
option_selection1_4=Original
option_selection1_5=B Grade
residence_country=AU
last_name=<removed>
option_selection1_6=Super High Copy
address_state=Queensland
payer_email=<removed>
option_name2_1=Extras
auth_exp=03:40:47 Sep 27, 2010 PDT
option_name2_2=Extras
option_name2_3=Extras
option_name2_4=Extras
option_name2_5=Extras
option_name2_6=Extras
address_city=<removed>
contact_phone=
payment_status=Voided
payment_date=03:40:47 Aug 29, 2010 PDT
parent_txn_id=
transaction_subject=Zw==
receiver_email=<removed> (personal email)
notify_version=3.0
remaining_settle=0
auth_status=Voided
address_country=<removed>
mc_gross=2.88
address_name=<removed>
option_name1_1=Quality
option_name1_2=Quality
option_name1_3=Quality
option_name1_4=Quality
option_name1_5=Quality
auth_amount=2.88
option_name1_6=Quality
I don't know if it will help, but I just included it anyway. I will also contact my host and see what they say about receiving the email.

Newbie

Posts

Joined
Sun Aug 29, 2010 7:14 pm
Location - brisbane, Australia
Who is online

Users browsing this forum: No registered users and 41 guests