If you use this answer and modify it slightly to include a searchkey so as to produce this:
public static function displayRecursiveResults($arrayObject,$searchkey) {
foreach($arrayObject as $key => $data) {
if(is_array($data)) {
displayRecursiveResults($data,$searchkey);
} elseif(is_object($data)) {
displayRecursiveResults($data,$searchkey);
} else {
if ($key === $searchkey)
echo "$key " . $data."<br />";
}
}
}
You will be able to use it like this:
displayRecursiveResults($arr,'status');
Get the $arr value by using any api that extends the PayPalModel's toArray() function (line 278) that will convert _propMap.
eg. my Agreement Api retrieves the payer info including the status field by using
$payerinfo = $agreement->getPayer();
My $agreement value is obtained after the customer has approved the subscription and been redirected to my site and the redirect function run.
try {
$agreement = \PayPal\Api\Agreement::get($agreement->getId(), $apiContext);
} catch (Exception $ex) {
\Yii::$app->response->format = \yii\web\Response::FORMAT_HTML;
\Yii::$app->response->data = $ex->getData();
exit(1);
}
I can then assign this to $arr by using:
$arr = $payerinfo->toArray();
From your data you are using the Payment api which extends the PayPalResearchModel which inturn extends the PayPalModel so you will be able to use the toArray() function. Reduce the Payment array size by using the subarray Payer.
$payer = New Payer;
$my_payer = $payer->getStatus();
$arr = $my_payer->toArray();
And then assign this to the above function
displayRecursiveResults($arr,'status');
and the value returned should be 'verified'.