Author Topic: This is for those of you who haven’t integrated PayPal Website Payment Pro yet.  (Read 43975 times)

Bingo

  • Beginner
  • *
  • Posts: 12
    • American Green Card Center
It took me about 2 days to integrate Paypal Pro and I am not very technical person, if I can don’t it so can you. Don’t be discourage, just follow these steps below. Disclosure: these are not my files

Step 1: Download and unzip the two files “Pear and Paypal” into your hard drive

Step 2: Upload these files on to your website using FTP.

For “Paypal” files go into /public_html/yourwebsite/administrator/components/com_virtuemart/classes/payment/(current folder)

→ paypal_dp
---ps_pdp.cfg.php
---ps_pdp.php

For “Pear” files go into
/public_html/yourwebsite/Pear/(current folder)

→ .registry folder
→ Archive   
→ Console
→ HTTP
→ Log
→ Net
→ PEAR
→ Services
--  Log.php
--  PEAR.php
--  pearcmd.php
--  System.php

Step 3: One line configuration in your “php.ini” file; look for “php.ini” file in /public_html/yourwebsite/php.ini

About halfway down look for

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include_path = “.:/usr/lib/php:/usr/local/lib/php”

make your include_path line look like this

include_path = “.:/usr/lib/php:/usr/local/lib/php:/home/public_html/yourwebsite/PEAR”


Step 4: Upload paypal keys live and sandbox cert_key_perm.txt (assume you already have an account with Paypal) to

/public_html/yourwebsite/pear/Services/Paypal/cert/(current folder)

---live.cert_key_perm.txt
---sandbox.cert_key_perm.txt


Step 5: Configurate Payment Methods

   1. Log into Virtuemart
   2. Go to List Payment Methods and click New top right
On General Tab
   3. Active?    Check the box to make it active
   4. Payment Method Name: Type “Paypal Direct Payment” or anything you wish.
   5. Code: Type “PDP”
   6. Payment class name: Type “ps_pdp”
   7. Payment method type: Click “Credit Card”
   8. Accepted Credit Card Types: Click Visa, MC, A. Express, Discover Card
On Configuration Tab
   9. Username: You get this from Paypal
          10. Password:   You get this from Paypal
          11. Subject: You can leave this blank
          12. Certificate: Insert url of your key here
          13. Mode: Pick Sandbox for testing   
          14. CVV: Pick Yes

At this point your ps_pdp.cfg.php file should look like this
Code: [Select]
<?php
defined
('_VALID_MOS') or die('Direct Access to this location is not allowed.'); 

define ('PDP_USERNAME''xxxxxxxxxx_api1.xxxxxxxxxxx.com');
define ('PDP_PASSWORD''xxxxxxxxxxxxxxx');
define ('PDP_SUBJECT''');
define ('PDP_CERTIFICATE''/home/public_html/yourwebsite/pear/Services/PayPal/cert/sandbox.cert_key_pem.txt');
define ('PDP_MODE''sandbox');
define ('PDP_CHECK_CARD_CODE''YES'); you need to add this line in for CVV
?>
Step 6: Testing Paypal Payment Pro

Make sure that you set your frontend features to allow customer to select their State/Region when fill out Billing and Shipping Address. Otherwise you would get this error

Quote
object(errortype)(9) { ["_elements"]=> array(5) { ["ShortMessage"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["LongMessage"]=> array(3) { ["required"]=> bool(false) ["type"]=> string(6) "string" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["ErrorCode"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(5) "token" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["SeverityCode"]=> array(3) { ["required"]=> bool(true) ["type"]=> string(16) "SeverityCodeType" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } ["ErrorParameters"]=> array(3) { ["required"]=> bool(false) ["type"]=> string(18) "ErrorParameterType" ["namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" } } ["_attributes"]=> array(0) { } ["_attributeValues"]=> array(0) { } ["_namespace"]=> string(31) "urn:ebay:apis:eBLBaseComponents" ["ShortMessage"]=> string(37) "The Billing Address State is invalid." ["LongMessage"]=> string(128) "The field Billing Address State is in an invalid format. For US/CA states and territories, enter a valid two letter state code." ["ErrorCode"]=> string(5) "10751" ["SeverityCode"]=> string(5) "Error" ["ErrorParameters"]=> NULL }
Failure in Processing the Payment:

The field Billing Address State is in an invalid format. For US/CA states and territories, enter a valid two letter state code.
Error: Failure in Processing the Payment (ps_pdp)


Failure in Processing the Payment:

The field Billing Address State is in an invalid format. For US/CA states and territories, enter a valid two letter state code.


Step 7: Take it LIVE

Edit your ps_pdp.cfg.php file (if you edit from List Payment Method the last line, define ('PDP_CHECK_CARD_CODE', 'YES'); ,will drop off. I don't know why)
Code: [Select]
<?php
defined
('_VALID_MOS') or die('Direct Access to this location is not allowed.'); 

define ('PDP_USERNAME''xxxxxxxxxx_api1.xxxxxxxxxxx.com');  real username
define 
('PDP_PASSWORD''xxxxxxxxxxxxxxx');  real password
define 
('PDP_SUBJECT''');
define ('PDP_CERTIFICATE''/home/public_html/yourwebsite/pear/Services/PayPal/cert/live.cert_key_pem.txt');
define ('PDP_MODE''LIVE');
define ('PDP_CHECK_CARD_CODE''YES'); you need to add this line in for CVV
?>

I don't think I left anything out, but if you get this far you should be able to figure the rest out.



[attachment deleted by admin]

[attachment cleanup by admin]

jasontmartinez27

  • Beginner
  • *
  • Posts: 11
Great thanks! I'll see what I can do!

jasontmartinez27

  • Beginner
  • *
  • Posts: 11
I tried everything and it seems to be almost there... the only thing is that when I submit an order, I get an error -  API initiation error: Could not find certificate file 'http://mysite.com/pear/Services/PayPal/cert/live.cert_key_perm.txt'

What is this?

Bingo

  • Beginner
  • *
  • Posts: 12
    • American Green Card Center
Quote
http://mysite.com/pear/Services/PayPal/cert/live.cert_key_perm.txt

That is the location where you save your real key (live key) to connect with Paypal. Did you generated API key at Paypal site yet?

jasontmartinez27

  • Beginner
  • *
  • Posts: 11
I sure did... and I believe it's in the appropriate folder. hmmm.....

Bingo

  • Beginner
  • *
  • Posts: 12
    • American Green Card Center
Go to your ps_pdp.cfg.php file in /public_html/yourwebsite/administrator/components/com_virtuemart/classes/payment/(current folder) and check to see if the codes look like the one below.

<?php
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');

define ('PDP_USERNAME', xxxxxxxxxx_api1.xxxxxxxxxxx.com');
define ('PDP_PASSWORD', 'xxxxxxxxxxxxxxxxx');
define ('PDP_SUBJECT', '');
define ('PDP_CERTIFICATE', '/home/public_html/yourwebsite/pear/Services/PayPal/cert/live.cert_key_pem.txt');
define ('PDP_MODE', 'LIVE');
define ('PDP_CHECK_CARD_CODE', 'YES');
?>

LongBranchAssociates

  • Jr. Member
  • **
  • Posts: 226
    • Long Branch Associates, LLC
Have you read the rules about using PayPal Payment Pro?  You also have to implement PayPal Express checkout - see all the Paper Work issued by PayPal about Payment Pro

If you implement Express Checkout as required your total Work Flow is screwed up as you must place Express Checkout upfront

We abandoned PayPal Payment Pro due to the need to change the Work Flow under PayPal rules and the potential future problems in upgrading VirtueMart in the future.  We changed our Payment Card processing to Authorize.net and just implemented the standard PayPal link with a bit of Javascript added to guide users through the process

We note that only around 10% of our Store customers use PayPal to pay for products compared to 90% using Payment Cards
lba-tech.com::VirtueMart eCommerce Online Stores for Small and Medium size businesses

Bingo

  • Beginner
  • *
  • Posts: 12
    • American Green Card Center
Yes, I read their little note about Direct Payment API is not a stand-alone product. And that we are required to use Direct Payment API and Express Checkout together as part of the Website Payments Pro solution. I don’t think they will turn away or terminate my account for not integrating Express Checkout. It would be very stupid business module for them, if they do. Just be on the safe side, I will also get Authorize.net. Thanks for the head-up. 

Pam1234

  • Beginner
  • *
  • Posts: 35
I reported in another thread that PayPal is retreating from this policy. I heard the news firsthand from a PayPal technician by phone. They are not announcing it but they will look the other way, is my understanding.

Pam

Bingo

  • Beginner
  • *
  • Posts: 12
    • American Green Card Center
That is great news. Thanks Pam

macadelic

  • Beginner
  • *
  • Posts: 2
Okay so far I've followed all the steps and thanx by the way, this is a major help by far, but I can not find the php.ini file to change the path and directories that is needed, I'm running joomla 1.0.8.  Am I overlooking something, please assist

Bingo

  • Beginner
  • *
  • Posts: 12
    • American Green Card Center
Your php.ini file is normally in /public_html/(currenct folder). Just make a copy and put it in /public_html/yourwebsite/current folder if you have more than one website going. In case, you actually don't have php.ine file you can also direct the path from .htaccess file. Refer to post, http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=15428.0,for editing from .htaccess file.

mrogers33us

  • Beginner
  • *
  • Posts: 7
Hello...thanks for the info...I've been able to do all except change the path in the php.ini. I don't have one.  Then I looked at trying to do it in the .htaccess file...but each time I try then after that my site doesn't work at all... and I really can't see where in that file I would change it...

so...how do I change that line? I really don't know how...

thanks

sumwatt

  • Beginner
  • *
  • Posts: 6
You can still get around this. Open up api_init.php and add the following lines to the top of the script before the include calls on the Services/PayPal.php file:

Code: [Select]
$include_path = ini_get('include_path');
$pear_path =  "/home/my/pathto/pear/";
if(!stristr($pear_path,$include_path)) ini_set('include_path',$include_path . PATH_SEPARATOR . $pear_path);

Be sure to change the $pear_path to point to the directory where you installed the Pear files.

sumwatt

  • Beginner
  • *
  • Posts: 6
To add onto this post -

If you get the path set correctly, you may run into an error that says something to the effect of getAck() is undefined. If this is the case, the problem is that your username, password or certificate is set incorrectly. This error happens because when you create the caller services profile (in the api_init.php file), if this is wrong it kills the chain of includes so that the API call fails prior to the request being sent and with no response, the getAck() function hasn't been defined yet.

One method to get around this (because it is based on PHP4 coding) is to change $response->getAck() to $response->Ack which is a public variable that can be accessed. getAck() returns the API Ack value to var $Ack