Object 如何访问braintree响应阵列?

Object 如何访问braintree响应阵列?,object,nested,response,braintree,Object,Nested,Response,Braintree,亲爱的Brantree开发者,我正在尝试在我的网站中实现braintree支付,braintree已经在数组对象中给出了响应,其中包含嵌套对象。我如何访问它?。我想从下面的回复中获得客户的id 充分披露:我在Braintree工作。如果您有任何进一步的问题,请随时联系 看起来这个响应来自一个客户创建的电话。- 检查指南的列表以获取其他属性 Braintree_Result_Successful Object ( [success] => 1 [_returnObjectNa

亲爱的Brantree开发者,我正在尝试在我的网站中实现braintree支付,braintree已经在数组对象中给出了响应,其中包含嵌套对象。我如何访问它?。我想从下面的回复中获得客户的id

充分披露:我在Braintree工作。如果您有任何进一步的问题,请随时联系

看起来这个响应来自一个客户创建的电话。-

检查指南的列表以获取其他属性

Braintree_Result_Successful Object
(
    [success] => 1
    [_returnObjectNames:private] => Array
        (
            [0] => customer
        )

    [_attributes] => Array
        (
        )

    [customer] => Braintree_Customer Object
        (
            [_attributes:protected] => Array
                (
                    [id] => 22635830
                    [merchantId] => h9xhpt9b5zjgbkpj
                    [firstName] => Abhishek
                    [lastName] => Sonawane
                    [company] => 1
                    [email] => abhishek@iarianatech.com
                    [phone] => 
                    [fax] => 
                    [website] => 
                    [createdAt] => DateTime Object
                        (
                        )

                    [updatedAt] => DateTime Object
                        (
                        )

                    [customFields] => 
                    [creditCards] => Array
                        (
                            [0] => Braintree_CreditCard Object
                                (
                                    [_attributes] => Array
                                        (
                                            [bin] => 510510
                                            [expirationMonth] => 12
                                            [expirationYear] => 2015
                                            [last4] => 5100
                                            [cardType] => MasterCard
                                            [cardholderName] => 
                                            [commercial] => Unknown
                                            [countryOfIssuance] => Unknown
                                            [createdAt] => DateTime Object
                                                (
                                                )

                                            [customerId] => 22635830
                                            [customerLocation] => US
                                            [debit] => Unknown
                                            [default] => 1
                                            [durbinRegulated] => Unknown
                                            [expired] => 
                                            [healthcare] => Unknown
                                            [imageUrl] => https://assets.braintreegateway.com/payment_method_logo/mastercard.png?environment=sandbox
                                            [issuingBank] => Unknown
                                            [payroll] => Unknown
                                            [prepaid] => Unknown
                                            [subscriptions] => Array
                                                (
                                                )

                                            [token] => 6k2mk2
                                            [uniqueNumberIdentifier] => 0ec6bdfe18781d1bccaea74c4fe55897
                                            [updatedAt] => DateTime Object
                                                (
                                                )

                                            [venmoSdk] => 
                                            [verifications] => Array
                                                (
                                                )

                                            [billingAddress] => 
                                            [expirationDate] => 12/2015
                                            [maskedNumber] => 510510******5100
                                        )

                                )

                        )

                    [addresses] => Array
                        (
                        )

                    [coinbaseAccounts] => Array
                        (
                        )

                    [paypalAccounts] => Array
                        (
                        )

                    [applePayCards] => Array
                        (
                        )
                )
        )
)
$result = Braintree_Customer::create([
    'firstName' => 'Mike',
    'lastName' => 'Jones',
    'company' => 'Jones Co.',
    'email' => 'mike.jones@example.com',
    'phone' => '281.330.8004',
    'fax' => '419.555.1235',
    'website' => 'http://example.com'
]);

$result->success;
# true

$id = $result->customer->id;