如何遍历PHP对象?

时间:2013-11-24 02:29:29

标签: php

我使用paymill处理付款,这是从PHP返回的对象:

__PHP_Incomplete_Class Object
(
    [__PHP_Incomplete_Class_Name] => Paymill\Models\Response\Transaction
    [_amount:Paymill\Models\Response\Transaction:private] => 001
    [_originAmount:Paymill\Models\Response\Transaction:private] => 1
    [_status:Paymill\Models\Response\Transaction:private] => closed
    [_description:Paymill\Models\Response\Transaction:private] => 1188 1387851784
    [_livemode:Paymill\Models\Response\Transaction:private] => 
    [_refunds:Paymill\Models\Response\Transaction:private] => 
    [_currency:Paymill\Models\Response\Transaction:private] => EUR
    [_responseCode:Paymill\Models\Response\Transaction:private] => 20000
    [_shortId:Paymill\Models\Response\Transaction:private] => 7357.7357.7357
    [_invoices:Paymill\Models\Response\Transaction:private] => Array
        (
        )

    [_payment:Paymill\Models\Response\Transaction:private] => __PHP_Incomplete_Class Object
        (
            [__PHP_Incomplete_Class_Name] => Paymill\Models\Response\Payment
            [_type:Paymill\Models\Response\Payment:private] => creditcard
            [_client:Paymill\Models\Response\Payment:private] => client_3cedc288233ed43c9bbb
            [_cardType:Paymill\Models\Response\Payment:private] => visa
            [_country:Paymill\Models\Response\Payment:private] => 
            [_expireMonth:Paymill\Models\Response\Payment:private] => 12
            [_expireYear:Paymill\Models\Response\Payment:private] => 2015
            [_cardHolder:Paymill\Models\Response\Payment:private] => test
            [_lastFour:Paymill\Models\Response\Payment:private] => 1228
            [_code:Paymill\Models\Response\Payment:private] => 
            [_account:Paymill\Models\Response\Payment:private] => 
            [_holder:Paymill\Models\Response\Payment:private] => 
            [_id:protected] => pay_2590c4d2f832a5d8bab1776f
            [_createdAt:protected] => 1385259786
            [_updatedAt:protected] => 1385259792
            [_appId:protected] => 
        )

    [_client:Paymill\Models\Response\Transaction:private] => __PHP_Incomplete_Class Object
        (
            [__PHP_Incomplete_Class_Name] => Paymill\Models\Response\Client
            [_email:Paymill\Models\Response\Client:private] => 
            [_description:Paymill\Models\Response\Client:private] => 
            [_payment:Paymill\Models\Response\Client:private] => Array
                (
                )

            [_subscription:Paymill\Models\Response\Client:private] => 
            [_id:protected] => client_3cedc288233ed43c9bbb
            [_createdAt:protected] => 1385259792
            [_updatedAt:protected] => 1385259792
            [_appId:protected] => 
        )

    [_preauthorization:Paymill\Models\Response\Transaction:private] => 
    [_fees:Paymill\Models\Response\Transaction:private] => Array
        (
        )

    [_feeAmount:Paymill\Models\Response\Transaction:private] => 
    [_feePayment:Paymill\Models\Response\Transaction:private] => 
    [_id:protected] => tran_d1a44121f123d0846839197ac0ce
    [_createdAt:protected] => 1385259792
    [_updatedAt:protected] => 1385259792
    [_appId:protected] => 
)

如何遍历此对象以获取client,responseCode,originAmount等内容?

编辑 Here's the PHP code I'm using

0 个答案:

没有答案