如何处理复杂的对象?

时间:2016-03-18 12:34:13

标签: php arrays object

我通过API获取响应对象。如何获得加粗([paymentStatus:Iyzipay \ Model \ Payment:private])键的价值?

Iyzipay\Model\CheckoutFormAuth Object
(

    [token:Iyzipay\Model\CheckoutFormAuth:private] => 
    [callbackUrl:Iyzipay\Model\CheckoutFormAuth:private] => 
    [price:Iyzipay\Model\Payment:private] => 
    [paidPrice:Iyzipay\Model\Payment:private] => 
    [installment:Iyzipay\Model\Payment:private] => 
    [paymentId:Iyzipay\Model\Payment:private] => 
    **[paymentStatus:Iyzipay\Model\Payment:private] => SUCCESS**
    [fraudStatus:Iyzipay\Model\Payment:private] => 
    [merchantCommissionRate:Iyzipay\Model\Payment:private] => 
    [merchantCommissionRateAmount:Iyzipay\Model\Payment:private] => 
    [iyziCommissionRateAmount:Iyzipay\Model\Payment:private] => 
    [iyziCommissionFee:Iyzipay\Model\Payment:private] => 
    [cardType:Iyzipay\Model\Payment:private] => 
    [cardAssociation:Iyzipay\Model\Payment:private] => 
    [cardFamily:Iyzipay\Model\Payment:private] => 
    [cardToken:Iyzipay\Model\Payment:private] => 
    [cardUserKey:Iyzipay\Model\Payment:private] => 
    [binNumber:Iyzipay\Model\Payment:private] => 
    [basketId:Iyzipay\Model\Payment:private] => 
    [paymentItems:Iyzipay\Model\Payment:private] => 
    [status:Iyzipay\IyzipayResource:private] => failure
    [errorCode:Iyzipay\IyzipayResource:private] => 5132
    [errorMessage:Iyzipay\IyzipayResource:private] => token gönderilmesi zorunludur
    [errorGroup:Iyzipay\IyzipayResource:private] => 
    [locale:Iyzipay\IyzipayResource:private] => tr
    [systemTime:Iyzipay\IyzipayResource:private] => 1458303873221
    [conversationId:Iyzipay\IyzipayResource:private] => 123456789
)

1 个答案:

答案 0 :(得分:2)

Iyzipay\Model\CheckoutFormAuth实现Iyzipay\Model\Payment个对象方法时,您可以使用该对象的getPaymentStatus()方法。

但是,如果出现任何其他问题,很容易检查source codes