I've been getting error 10002 'Security Header is not Valid' when trying to use the Paypal API with NVP php sample code. I started hacking at the project of integrating Joomla Virtuemart with the paypal DoDirectPayment API. I first made a standalone php file which calls the API to process a hardcode transaction. The file works when I load that single file directly no problem. I can check the transaction online at the sandbox. Then when I try to load this file during the checkout process in Joomla it gives me the error 10002 'Security Header is not Valid'. I then dived into the code and found out the way to solve is to replace the line
global $environment;
with
$environment = 'sandbox'; // or 'beta-sandbox' or 'live'
make sure you cut this line from outside the function
function PPHttpPost
This should solve your problem. Then you can experiment more and pack the string from your session, and your API should work no problem. Drop me a line if you have any question.
Showing posts with label Dodirectpayment. Show all posts
Showing posts with label Dodirectpayment. Show all posts
Thursday, November 27, 2008
Monday, November 17, 2008
PayPal Php SDK
Recently I am at a project regarding integrating the paypal direct payment pro at a coffee shopping website. Over at Paypal there are a lot of documentations on how to install the php sdk for one to test. However when I was trying to type in the command line
C:\>php install.php
I get the error message
C:\phpsdk>php install.php
INSTALLATION ERROR:
Please cd to the C:\phpsdk and run install.php
at the designated directory, I get the error message telling me to cd to that directory of /php-sdk/ then try it again. But I AM at that directory! I tried looking online and checked the version of php and other software inside XAMPP, and I couldn't find the problem. Then I jumped into the code of the install.php and found that the error. When I was unpacking my data, I had the folder named phpsdk, and that's where php keeps flaging me. The problem is the NAME of the directory (not the path to it) holding php-sdk HAS to be "php-sdk" exactly. And after this error, I basically got the SDK setup and got sandbox to deal with payments in no time.
C:\>php install.php
I get the error message
C:\phpsdk>php install.php
INSTALLATION ERROR:
Please cd to the C:\phpsdk and run install.php
at the designated directory, I get the error message telling me to cd to that directory of /php-sdk/ then try it again. But I AM at that directory! I tried looking online and checked the version of php and other software inside XAMPP, and I couldn't find the problem. Then I jumped into the code of the install.php and found that the error. When I was unpacking my data, I had the folder named phpsdk, and that's where php keeps flaging me. The problem is the NAME of the directory (not the path to it) holding php-sdk HAS to be "php-sdk" exactly. And after this error, I basically got the SDK setup and got sandbox to deal with payments in no time.
Wednesday, November 12, 2008
Install website payment pro Paypal API in Joomla virtuemart
How to install PayPal Pro US recurring direct payment for virtuemart?
1.copy the files to related folder.
2. Go to your VirtueMart Payment configuration screen (add payment)
3. Name the new Payment Module as whatever you prefered .
4.Set Code: PP_RE
Payment class name: ps_paypal_prosub
Payment class type: credit card
5. Click save
6. Edit the new Payment Method again and click on configuration
7. Fill out form and MAKE SURE WHETHER YOU WILL USE SANDBOX .
You also need to enter your PayPal API signature information which you can find in your PayPal Profile (click API Signature) in your PayPal account.
8. Click Save
- 9. Make sure it's enabled.
Subscribe to:
Posts (Atom)