/************************************************************************ Written by Hunter Sinclair - All Rights Reserved. Copyright 2005 - Zenatdesign.com. Version 1.0 Joomla Paypal Pro for Joomla/Virtuemart is Commercial Software Do not distribute without permission. Do not remove this from file. Please contact hunter@ggi.net for licensing or purchase questions ************************************************************************/ NOTICE: The file shop.cart.php is being distributed with this package as free code under Joomla/virtuemart GNU license. We have just made modifications to this file to support Paypal Express. All other files are propritary and protected. ################################################# ### VERSION CONTROL ### ################################################# Current Version = 1.0 - Initial Release ################################################# ### REQUIREMENTS ### ################################################# ****** This install does not require the Paypal Pro SDK at all ******** ****** This payment module (when used as described below) meets******** ****** all Paypal Business Rules for Website Payments Pro. ******** Joomla! 1.0.4 eCommerce Edition OR (Joomla 1.0 w/joomla-virtuemart 1.0.5) older versions may require some tweeking PHP Version 4.1 + OpenSSL/0.9.6b + CURL support enabled - libcurl/7.10.4 OpenSSL/0.9.6b zlib/1.1.4 MySQL Server Database You need SSL (HTTPS) enabled on your server for LIVE transactions (testing without on Sandbox is fine) The above are only estimates - these are what I used to install on and I know they work - older versions may work as well. ################################################# ### SETUP SANDBOX ### ################################################# 1. Login to developer.paypal.com 2. click Create Sandbox account. 3. Setup a Business Account (type in all your business info - doesnt matter what emails you use since emails will not go to actual account - they go to your sandbox email account in developer.paypal.com) 4. Go back to developer.paypal.com -> Email -> Activate your Paypal Account from the email sent to the email you just setup. 5. Click the link in the email to activate and enter the password you just created. Click Continue. 6. Add a credit card. Leave generated info in fields and click add. 7. Add bank account: Enter anything in Bank name -> Click Add -> Continue 8. Confirm Bank Account: Submit->Continue 9. Then signup for Paypal Pro in the sandbox account: Merchant Account Tab ->Websites Payments Pro->Submit Application - Enter all required fields on first page - doesnt really mater. - On second page Enter a social Security Number starting with 111 that has not already been used and accept agreement. - Continue 10. Wait for application to be approved (on sandbox this is minutes, on live account this can take 2 days). 11. Once approved you must log into your account and Approve Billing Agreement->Approve 12. Go to Profile->API Access-> click second link and get a certificate (make note of account name and password) 13. Download certificate (name it: sandbox_cert_key_pem.txt) to local drive and wherever you will put it on your server. **** PLEASE NOTE: if you call the certificate anything other than sandbox_cert_key_pem.txt then you will have to modify this in the Payment Module Settings 14. Go to Profile->API Access-> click first link and add access for account name just generated. ################################################# ### INSTALL AND TEST ### ################################################# 1. Extract all files from joomla_paypal_pro.zip to a testing directory. 2. You may want to make backups of the following file, because it will be replaced upon upload. /administrator/components/com_virtuemart/html/shop.cart.php 3. Upload all files to your server. (including YOUR certificate) *** CERTIFICATE should be placed in your mambo installation root, otherwise you will need to change the location in the Payment module settings. (All files/folders should be uploaded to the ROOT of your mambo install) 4. Set file permissions (CHMOD 766) to writable for: /administrator/components/com_virtuemart/classes/payment/ps_paypal_pro_dcc.cfg.php 5. Go to Admin-> Select "joomla-virtuemart" from the components menu-> Select "Add Payment Method" from the secondary navigation for phpShop Store-> 6. Type the following into the fields: -Check the first box -Payment Method Name = "Paypal Pro - Direct Payment" (if you do not want your customers to see this - you should enter "Credit Card" instead) -Payment Code = "PP_PRO_D" -Payment Class Name = "ps_paypal_pro_dcc" -Payment Method Type = "Use Payment Processor" Leave the rest and click SAVE at the top right 7. Now click on the "Paypal Pro - Direct Payment" (or whatever you called it) in the payment method list. Click on the configuration tab Enter all of your information for your account. - Set to TEST Mode to YES, otherwise it will be pointed to LIVE server - API Username - API password - Paypal Email - Certificate Name/Location - etc CLICK SAVE at the top right ******PLEASE NOTE: If you accept other payment methods that use the payment processor like authorize.net you must go in to these and change the USE CVV2 field to YES or it will not show to the customer. 8. Go to Administrator Console->components->joomla-virtuemart->Admin->Configure->Global II -Select the "Customers can select a state/region?" checkbox *** PLEASE NOTE: You must make sure that permissions on phpshop.cfg.php are set to write (CHMOD 766) to modify these settings. Located at /administrator/components/com_virtuemart/ 9. Go to Administrator Console->Site->Global Configuration -Make sure that "Require Unique Email:" is set to NO -It is recommended that "Use New Account Activation" is set to NO -It is recommended that "Allow User Registration" is set to YES *** PLEASE NOTE: You must make sure that permissions on configure.php are set to write (CHMOD 766) to modify these settings. Located in root. 10. Your good to go. *** If you are testing the Express Checkout - you must be logged into developer.paypal.com for it to work. *** You can disable Paypal Express Checkout by not installing the shop.cart.php file, but ################################################# ### GOING LIVE INSTRUCTIONS ### ################################################# 1. Signup for a Paypal Pro Payment through the merchant tools of your live business account. (wait a few days for approval and aggre to billing agreement) 2. Go to PAYPAL->Profile->API Access-> click second link and get a certificate (make note of account name) 3. Download certificate (cert_key_pem.txt) to local drive and wherever you will put it on your server. 4. Go to PAYPAL->Profile->API Access-> click first link and add access for account name just generated. 5. Insure that your paypal account is all verified and you have a bank account registered and confirmed address. 6. Upload the NEW LIVE certificate to your server. 7. Go to Admin-> Select "joomla-virtuemart" from the components menu-> Select "Payment Method List" from the secondary navigation for phpShop Store-> 8. Now click on the "Paypal Pro - Direct Payment" (or whatever you called it) in the payment method list. Click on the configuration tab Change all of your information to reflect that of your LIVE account. - Change Test Mode to NO - Change API Username to LIVE one - Change API password to LIVE one - Change Paypal Email to LIVE account email - Change Certificate Name/Location to cert_key_pem.txt or whatever you named it 9. Click the Test Certificate Link to make sure you have the right certificate. 10. Don't forget to click SAVE at the top right. *** PLEASE NOTE: You must make sure that permissions on ps_paypal_pro_dcc.cfg.php are set to write (CHMOD 766) to modify these settings. Located at /administrator/components/com_virtuemart/classes/payment/ 11. Your good to go. ################################################# ### MOST COMMON MISTAKES ### ################################################# 1. You do not have the correct email address, API username, and API password in the payment module settings (the email is the one for your paypal account, the username and password are the ones for your API certificate) 2. You have not downloaded a API certificate for the account you are testing and replaced the existing one on the server. (sandbox and live are different) - Your certificate is named differently, located in a diffent spot, or otherwise MIA. Use the Test Certificate Link to verify that you have the right one (you might want to compare it to the one downloaded) 3. ******VERY COMMON MISTAKE - You have not added the API username (example_api1.domain.com) to your API Access list in your paypal account. PAYPAL->Profile->API access->first link (access)->ADD 4. You have the payment module set to Test Mode = Yes, but have entered live settings (OR vice versa) 5. You are not using a valid test CC - you can not use a real CC for testing sandbox accounts (you must use one generated on the ADD credit card page in your paypal sandbox account) - just use 000 for CVV and any future date 6. You are trying to pay through express paypal and are trying to login using the very same account your are trying to pay - you must pay with a separate paypal account (you cant pay yourself) - if in sandbox - just create another one 7. You have not verified your address, validated your CC, validated your bank account or verified you email address in your paypal account. ################################################# ### COMMON ERRORS AND SOLUTIONS ### ################################################# ERROR - IF YOU GET AN PAYPAL CC ERROR WITHOUT ANY DETAILS OR "unable to set certificate file" 1. **** BIGGEST MISTAKE **** Your certificate either doe not exist, or it can not be read - try going to it directly and make SURE that you have it named properly in the module settings (use the test certificate link). 2. Your SOAP/XML message is somehow screwed up - this might be due to alot of unknown factors (try uncommenting the debug lines in the ps_paypal_pro_dcc.php - (Lines under: // TEST XML OUTPUT)) This will output the several things and you can see if everythign is being populated correctly. ERROR - You do not have permission to make this API call: 1. This is almost ALWAYS because you have not given access to the API username that was generated by the certificate. To do this: Goto PAYPAL->Profile->API access->first link (access)->ADD and add your API username (example_api1.domain.com) - make sure to select all the checkboxes. 2. It could be that you have the wrong Paypal Email address in your settings...make sure it is the one for the account associated with the certificate you are using. ERROR - The username/password is incorrect. 1. This is either do to not having the correct API username and password set in your module settings OR you have a API certificate that does not match the API username and password you entered. Make sure this is the API username and password that is related to the certificate and NOT your paypal account login. 2. Make sure you have the correct certificate for the settings (LIVE cert. with live username/pass and SANDBOX cert. with sandbox username/password) 3. This can also be the message sometimes when the location of certificate is messed up with double slashes // - if you have entered a location before your certificate like /includes/bla/cert_key_pem.txt (then try it without the prepended /) ERROR - Direct Payment (or some other function) has been disabled on this account: 1. This happens from time to time, due to multiple failed attempts - best bet is to just set up a whole new sandbox account. ERROR - SSL: error:00000001:lib(0):func(0):reason(1) 1. This can be many things, but I have seen it specifically when trying to send a LIVE account's certificate and having YES in the Test Mode option (as opposed to what it should be NO) Example Sandbox Account: email: info@paypalprodemo.com password: paypalpropass example cc: Visa 4983599115150124 CVV2-000 EXP 01/2006