iam new paypal php sdk code iam using
$rpprofiledetails = new recurringpaymentsprofiledetailstype(); $rpprofiledetails->subscribername = 'test customer'; $rpprofiledetails->billingstartdate = '29/5/2016'; $activationdetails = new activationdetailstype(); $activationdetails->initialamount = new basicamounttype($currencycode, 10); $activationdetails->failedinitialamountaction = 'continueonfailure';//$_request['failedinitialamountaction']; $paymentbillingperiod = new billingperioddetailstype(); $paymentbillingperiod->billingfrequency = 365;//$_request['billingfrequency']; $paymentbillingperiod->billingperiod = 'day';//$_request['billingperiod']; $paymentbillingperiod->totalbillingcycles = 365;//$_request['totalbillingcycles']; $paymentbillingperiod->amount = new basicamounttype($currencycode, 10);//$_request['paymentamount'] $scheduledetails = new scheduledetailstype(); $scheduledetails->description = 'artist access amount';//$_request['profiledescription']; $scheduledetails->paymentperiod = $paymentbillingperiod; $createrpprofilerequestdetail = new createrecurringpaymentsprofilerequestdetailstype(); $_request['token'] =''; if(trim($_request['token']) != "") { $createrpprofilerequestdetail->token = $_request['token']; } else { $creditcard = new creditcarddetailstype(); $creditcard->creditcardnumber = '41111111111111111';//$_request['creditcardnumber']; $creditcard->creditcardtype = 'visa';//$_request['creditcardtype']; $creditcard->cvv2 = '111';//$_request['cvv']; $creditcard->expmonth = '9';//$_request['expmonth']; $creditcard->expyear = '2022';//$_request['expyear']; $createrpprofilerequestdetail->creditcard = $creditcard; } $createrpprofilerequestdetail->scheduledetails = $scheduledetails; $createrpprofilerequestdetail->recurringpaymentsprofiledetails = $rpprofiledetails; $createrpprofilerequest = new createrecurringpaymentsprofilerequesttype(); $createrpprofilerequest->createrecurringpaymentsprofilerequestdetails = $createrpprofilerequestdetail; $createrpprofilereq = new createrecurringpaymentsprofilereq(); $createrpprofilereq->createrecurringpaymentsprofilerequest = $createrpprofilerequest; $config = array( // values: 'sandbox' testing // 'live' production "mode" => "sandbox", 'log.logenabled' => true, 'log.filename' => '../paypal.log', 'log.loglevel' => 'fine', // these values defaulted in sdk. if want override default values, uncomment , add value. // "http.connectiontimeout" => "5000", // "http.retry" => "2", // signature credential "acct1.username" => "asp.mobileappz_api1.gmail.com", "acct1.password" => "tr2r87q3w7xt7ujq", "acct1.signature" => "afcwxv21c7fd0v3byyyrcpssrl31abq4txmps2aojtnvgh-zrkhgwy3d", // subject optional , required in case of third party authorization // "acct1.subject" => "", // sample certificate credential // "acct1.username" => "certuser_biz_api1.paypal.com", // "acct1.password" => "d6jnkkulhn3g5b8a", // certificate path relative config folder or absolute path in file system // "acct1.certpath" => "cert_key.pem", // subject optional , required in case of third party authorization // "acct1.subject" => "", ); $paypalservice = new paypalapiinterfaceserviceservice($config); try { /* wrap api method calls on service object try catch */ $createrpprofileresponse = $paypalservice->createrecurringpaymentsprofile($createrpprofilereq); } catch (exception $ex) { echo '<pre>'; print_r($ex); //include_once("../error.php"); exit; } if(isset($createrpprofileresponse)) { echo "<table>"; echo "<tr><td>ack :</td><td><div id='ack'>$createrpprofileresponse->ack</div> </td></tr>"; echo "<tr><td>profileid :</td><td><div id='profileid'>".$createrpprofileresponse->createrecurringpaymentsprofileresponsedetails->profileid ."</div> </td></tr>"; echo "</table>"; echo "<pre>"; print_r($createrpprofileresponse); echo "</pre>"; } } ack : failure profileid : paypal\paypalapi\createrecurringpaymentsprofileresponsetype object ( [createrecurringpaymentsprofileresponsedetails] => paypal\eblbasecomponents\createrecurringpaymentsprofileresponsedetailstype object ( [profileid] => [profilestatus] => [transactionid] => [dccprocessorresponse] => [dccreturncode] => ) [timestamp] => 2016-06-07t03:29:31z [ack] => failure [correlationid] => 9c2a8533bb7f5 [errors] => array ( [0] => paypal\eblbasecomponents\errortype object ( [shortmessage] => security error [longmessage] => security header not valid [errorcode] => 10002 [severitycode] => error [errorparameters] => ) ) [version] => 106.0 [build] => 22204133 )
i have crossed check not because of wrong credentails have setup sandbox account on developer.paypal.com url sdk create of sand box, show how not working please help. have absolutely no clue. standard example paypal sdk itself. please suggest iam wrong.
10002 refers incorrect api credentials, using live paypal account credentials , code set sandbox
"mode" => "sandbox",
change live environment , try again.