0

I am trying to create recurring profile in paypal

Here is my code

<?php

$qs = "";

$username = "xxx";
$password = "xxx";
$signature = "xxx";

$qs = "USER=".$username;
$qs .= "&PWD=".$password;
$qs .= "&SIGNATURE=".$signature;
$qs .= "&METHOD=CreateRecurringPaymentsProfile";
$qs .= "&VERSION=86";
$qs .= "&PAYERID=1";
$qs .= "&PROFILESTARTDATE=2015-08-13T";
$qs .= "&DESC=recurrning payment";
$qs .= "&BILLINGPERIOD=Month";
$qs .= "&BILLINGFREQUENCY=1";
$qs .= "&AMT=10";
$qs .= "&CURRENCYCODE=AUD";
$qs .= "&COUNTRYCODE=AU";
$qs .= "&MAXFAILEDPAYMENTS=3";

header('location:https://api-3t.sandbox.paypal.com/nvp?'.$qs);



?>

From above code,i got the error security header is not valid

Can anybody help me

Yeldar Kurmangaliyev
  • 33,467
  • 12
  • 59
  • 101
  • http://stackoverflow.com/questions/23261766/paypal-gateway-has-rejected-request-security-header-is-not-valid-10002-secur/23265150#23265150 – Vimalnath Aug 13 '15 at 04:49

1 Answers1

0

Use %20 instead of space (' ') in URL might help you to solve the error [Though I'm not sure]:

<?php
$qs = "";

$username = "xxx";
$password = "xxx";
$signature = "xxx";

$qs = "USER=".$username;
$qs .= "&PWD=".$password;
$qs .= "&SIGNATURE=".$signature;
$qs .= "&METHOD=CreateRecurringPaymentsProfile";
$qs .= "&VERSION=86";
$qs .= "&PAYERID=1";
$qs .= "&PROFILESTARTDATE=2015-08-13T";
$qs .= "&DESC=recurrning%20payment";//replace the space
$qs .= "&BILLINGPERIOD=Month";
$qs .= "&BILLINGFREQUENCY=1";
$qs .= "&AMT=10";
$qs .= "&CURRENCYCODE=AUD";
$qs .= "&COUNTRYCODE=AU";
$qs .= "&MAXFAILEDPAYMENTS=3";

header('location:https://api-3t.sandbox.paypal.com/nvp?'.$qs);
?>
Al Amin Chayan
  • 2,460
  • 4
  • 23
  • 41
  • check your **$username**, **$password** & **$signature** value and the proper manual for doing this. You can check [this](http://stackoverflow.com/questions/1712685/express-checkout-error-message-security-header-is-not-valid), [this](https://support.bigcommerce.com/articles/Public/What-does-Security-Header-is-Not-Valid-10002-for-PayPal-mean) & [this](http://stackoverflow.com/questions/23358683/paypal-express-checkout-error-security-header-is-not-valid) aslo. – Al Amin Chayan Aug 13 '15 at 04:52
  • which url is to be set in header('location:') for paypal business account –  Aug 13 '15 at 04:53
  • please visit the suggested links in my previous comment. – Al Amin Chayan Aug 13 '15 at 04:54