首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Square transactions Api -检索请求结果

Square transactions Api -检索请求结果
EN

Stack Overflow用户
提问于 2018-08-06 00:11:48
回答 1查看 344关注 0票数 0

请帮助我了解下一步需要做什么。我正在使用广场交易API接受电子商务网站上的付款。我从生成的表单中获得了nonce,我希望得到下面的响应。现在,我需要从该响应中检索值,并将它们存储在变量中,以便可以继续为要执行的订单创建采购订单。

代码语言:javascript
复制
SquareConnect\Model\ChargeResponse Object
(
    [errors:protected] => 
    [transaction:protected] => SquareConnect\Model\Transaction Object
        (
            [id:protected] => ...
            [location_id:protected] => ...
            [created_at:protected] => 2018-08-05T15:45:48Z
            [tenders:protected] => Array
                (
                    [0] => SquareConnect\Model\Tender Object
                        (
                            [id:protected] => ...
                            [location_id:protected] => ..
                            [transaction_id:protected] => ...
                            [created_at:protected] => 2018-08-05T15:45:48Z
                            [note:protected] => Online Transaction
                            [amount_money:protected] => SquareConnect\Model\Money Object
                                (
                                    [amount:protected] => 20448
                                    [currency:protected] => USD
                                )

                            [tip_money:protected] => 
                            [processing_fee_money:protected] => 
                            [customer_id:protected] => 
                            [type:protected] => CARD
                            [card_details:protected] => SquareConnect\Model\TenderCardDetails Object
                                (
                                    [status:protected] => CAPTURED
                                    [card:protected] => SquareConnect\Model\Card Object
                                        (
                                            [id:protected] => 
                                            [card_brand:protected] => VISA
                                            [last_4:protected] => 1111
                                            [exp_month:protected] => 
                                            [exp_year:protected] => 
                                            [cardholder_name:protected] => 
                                            [billing_address:protected] => 
                                            [fingerprint:protected] =>...
                                        )

                                    [entry_method:protected] => KEYED
                                )

                            [cash_details:protected] => 
                            [additional_recipients:protected] => 
                        )

                )

            [refunds:protected] => 
            [reference_id:protected] => 
            [product:protected] => EXTERNAL_API
            [client_id:protected] => 
            [shipping_address:protected] => 
            [order_id:protected] => 
        )
)

我只需要确认卡已充值的交易结果

EN

回答 1

Stack Overflow用户

发布于 2018-08-07 03:23:52

您需要使用Getter方法来访问私有属性。例如:https://github.com/square/connect-php-sdk/blob/master/docs/Model/ChargeResponse.md

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51696044

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档