从对象内部的数组创建对象

时间:2019-05-20 11:57:52

标签: php arrays object

我有一个这样的对象,里面有一个数组:

    Abc Object
(
   [attributes:protected] => Array
       (
           [id] => xx
           [entity] => payment
           [amount] => 1475047
           [order_id] =>
           [invoice_id] =>
           [created_at] => 1558350389
       )
)

如何从中获取identityamountinvoice_idorder_id作为对象?

修改 调用外部API:

    $api = new Api($dbres[0]['api_key'], $dbres[0]['secret_key']);
   $payment = $api->payment->fetch($validationObj['paymentReference']);
   $respObj = $payment->capture(array('amount' => $validationObj['amount'])) ;

   print_r($respObj);exit;

0 个答案:

没有答案