-1

i want to get profile id from this array

[2019-05-21 07:30:24] main.DEBUG: array (
  'url' => 'https://api-3t.sandbox.paypal.com/nvp',
  'CreateRecurringPaymentsProfile' => 
  array (
    'TOKEN' => 'EC-7KH42411WM009054M',
    'AMT' => 5997.0,
    'CURRENCYCODE' => 'USD',
    'BILLINGPERIOD' => 'Year',
    'PROFILESTARTDATE' => '2019-05-28 07:30:22',
    'DESC' => 'Master Subscription',
    'BILLINGFREQUENCY' => '1',
    'METHOD' => 'CreateRecurringPaymentsProfile',
    'VERSION' => '72.0',
    'USER' => '****',
    'PWD' => '****',
    'SIGNATURE' => '****',
    'BUTTONSOURCE' => 'Magento_Cart_Community',
  ),
  'response' => 
  array (
    'PROFILEID' => 'I-M95NGSXREWAC',
    'PROFILESTATUS' => 'ActiveProfile',
    'TIMESTAMP' => '2019-05-21T07:30:24Z',
    'CORRELATIONID' => 'f61750cc16cac',
    'ACK' => 'Success',
    'VERSION' => '72.0',
    'BUILD' => '000000',
  ),
)
  • please attach code where you get this array value – Rk Rathod May 21 at 7:44
  • public function callCreateRecurringPaymentsProfile() { $request = $this->_exportToRequest($this->_createRecurringPaymentsProfileRequest); $this->_exportLineItemsSubs($request); $response = $this->call('CreateRecurringPaymentsProfile', $request); //$logger = \Magento\Framework\App\ObjectManager::getInstance()->get('\Psr\Log\LoggerInterface'); //$logger->debug(print_r("profile status". $response["response"],true)); $this->_importFromResponse($this->_createRecurringPaymentsProfileResponse, $response); } – imtiazau May 21 at 7:49
  • actually i want to save profile id value in payment additonal – imtiazau May 21 at 7:49
  • get this array in $response["response"]? – Rk Rathod May 21 at 7:54
  • $response = $api->callCreateRecurringPaymentsProfile(); i am calling this funciton – imtiazau May 21 at 8:10
0

if you get above array everytime in same format, then you can use below code for to get PROFILEID.

$arr = $api->callCreateRecurringPaymentsProfile();
if(isset($arr[0]['response']['PROFILEID']) && strlen($arr[0]['response']['PROFILEID']) > 0){
     echo "proFile_id:".$arr[0]['response']['PROFILEID'];
}

I hope it will help...!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.