tags:

views:

65

answers:

1

i download sample code from https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_DoDirectPayment_php.txt

run and get

TIMESTAMP=2010%2d05%2d11T04%3a42%3a06Z&CORRELATIONID=ac15852d1e958&ACK=Failure&VERSION=51%2e0&BUILD=1268624&L_ERRORCODE0=10002&L_SHORTMESSAGE0=Security%20error&L_LONGMESSAGE0=Security%20header%20is%20not%20valid&L_SEVERITYCODE0=Error' (length=233)

what is problem ? api username ? api pass ? signature or anything else ?

this infor i fill in source code:

// Set request-specific fields.
$paymentType = urlencode('Authorization');              // or 'Sale'
$firstName = urlencode('Nguyen');
$lastName = urlencode('Quang Trung');
$creditCardType = urlencode('Visa');
$creditCardNumber = urlencode(' 

4111111111111111');
$expDateMonth = '04';
// Month must be padded with leading zero
$padDateMonth = urlencode(str_pad($expDateMonth, 2, '0', STR_PAD_LEFT));

$expDateYear = urlencode('2015');
$cvv2Number = urlencode('5360 ');
$address1 = urlencode('ha noi');
$address2 = urlencode('hcm');
$city = urlencode('ha noi');
$state = urlencode('ha noi state');
$zip = urlencode('84');
$country = urlencode('viet nam');               // US or other valid country code
$amount = urlencode('900');
$currencyID = urlencode('USD');                         // or other currency ('GBP', 'EUR', 'JPY', 'CAD', 'AUD')
A: 

Refer the error codes here. Also the reponse from Paypal clearly says there is a Security Header is not valid.

LONGMESSAGE0=Security%20header%20is%20not%20valid

Make sure you enter the correct API Password, Username etc

Shoban
thank to you , i will try it .But in sandbox , how to fill all infor of credit card , haven't a credit card :D
Chameron
I think you can try 4111111111111111 which is a valid credit card format.
Shoban
thanks for help
Chameron