Welcome, Guest. Please login or register.
Login with username, password and session length


Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
VirtueMart ForumVirtueMart Dev/Coding CentralDevelopment Projects, Modifications, Hacks & TweaksPayment Modules (Moderator: deneb)This is for those of you who haven’t integrated PayPal Website Payment Pro yet.
Pages: [1] 2 3   Go Down
Print
Author Topic: This is for those of you who haven’t integrated PayPal Website Payment Pro yet.  (Read 25142 times)
Bingo
Newbie
*
Posts: 12


WWW
« on: April 16, 2006, 19:49:29 PM »

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:
<?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:
<?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]

* paypal.zip (5.02 KB - downloaded 473 times.)
Logged

jasontmartinez27
Newbie
*
Posts: 11


« Reply #1 on: April 16, 2006, 23:15:48 PM »

Great thanks! I'll see what I can do!
Logged
jasontmartinez27
Newbie
*
Posts: 11


« Reply #2 on: April 19, 2006, 21:40:26 PM »

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?
Logged
Bingo
Newbie
*
Posts: 12


WWW
« Reply #3 on: April 19, 2006, 22:44:32 PM »

Quote

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?
Logged

jasontmartinez27
Newbie
*
Posts: 11


« Reply #4 on: April 20, 2006, 09:02:08 AM »

I sure did... and I believe it's in the appropriate folder. hmmm.....
Logged
Bingo
Newbie
*
Posts: 12


WWW
« Reply #5 on: April 20, 2006, 22:19:32 PM »

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');
?>
Logged

LongBranchAssociates
Full Member
***
Posts: 226


WWW
« Reply #6 on: April 21, 2006, 08:21:48 AM »

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
Logged

lba-tech.com::VirtueMart eCommerce Online Stores for Small and Medium size businesses
Bingo
Newbie
*
Posts: 12


WWW
« Reply #7 on: April 21, 2006, 20:24:32 PM »

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

Pam1234
Newbie
*
Posts: 35


« Reply #8 on: April 21, 2006, 23:21:00 PM »

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
Logged
Bingo
Newbie
*
Posts: 12


WWW
« Reply #9 on: April 22, 2006, 09:40:54 AM »

That is great news. Thanks Pam
Logged

macadelic
Newbie
*
Posts: 2


« Reply #10 on: April 24, 2006, 03:49:00 AM »

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
Logged
Bingo
Newbie
*
Posts: 12


WWW
« Reply #11 on: April 24, 2006, 17:07:34 PM »

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

mrogers33us
Newbie
*
Posts: 7


« Reply #12 on: May 10, 2006, 11:28:29 AM »

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
Logged
sumwatt
Newbie
*
Posts: 6


« Reply #13 on: May 11, 2006, 10:12:06 AM »

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:
$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.
Logged
sumwatt
Newbie
*
Posts: 6


« Reply #14 on: May 11, 2006, 10:55:37 AM »

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
Logged
Pages: [1] 2 3   Go Up
Print
Jump to: