0

I am using the following code for Paypal Express.

$settings = array(
            'username' => 'XXXX',
            'password' => 'XXX',
            'signature' => 'XXXX',
            'test_mode' => TRUE
        );

while i am using the above code, following error message shown

Merchant_response Object
(
    [_status:protected] => failed
    [_message:protected] => Security header is not valid
    [_reference:protected] => 
    [_data:protected] => 
    [_redirect_url:protected] => 
    [_redirect_method:protected] => GET
    [_redirect_message:protected] => 
    [_redirect_data:protected] => 
)

but, if I changed the test_mode as false, its working fine (redirect to paypal payment page). can any one tell me how I can work test_mode?

I created My API by using the following steps

 Profile -> My Selling Tools -> Selling Online – API Access -> Update -> 
Request API Credentials – Request API signature -> Agree and Submit 

while creating API, where I Specified the Sandbox mode?

Apul Gupta
  • 3,044
  • 3
  • 22
  • 30
saravankg
  • 909
  • 1
  • 10
  • 21
  • possible duplicate of [paypal express checkout =>Error: Security header is not valid](http://stackoverflow.com/questions/23358683/paypal-express-checkout-error-security-header-is-not-valid) – Thomas Bouman Jun 10 '15 at 13:45
  • I made mistake by using the live mode api details for sandbox or test mode. GO TO your developer paypal account and select Busiiness and go to your profile page. the sand box or test mode API details are specified in API credential tap. – saravankg Jun 11 '15 at 05:04

1 Answers1

0

hello you should to use environment and set it to sandbox like that

$settings = array(
            'username' => 'XXXX',
            'password' => 'XXX',
            'signature' => 'XXXX',
            'test_mode' => TRUE,
            'environment'=>'sandbox'
);
Aabid
  • 953
  • 5
  • 23