【问题标题】:Square transactions Api - retrieving request resultsSquare transactions Api - 检索请求结果
【发布时间】:2019-09-09 23:07:43
【问题描述】:

请帮助我了解我接下来需要做什么。我正在使用方形交易 API 来接受电子商务网站上的付款。我从生成的表单中得到了随机数,我希望得到下面的回复。我现在需要从此响应中检索值并将它们存储在变量中,以便我可以继续为要履行的订单创建采购订单。

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] => 
        )
)

我只需要确认卡被扣款的交易结果

【问题讨论】:

    标签: api transactions square


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2018-01-09
      • 2021-02-01
      • 1970-01-01
      • 2018-03-29
      • 1970-01-01
      • 2020-07-14
      • 1970-01-01
      • 1970-01-01
      • 2021-12-06
      相关资源
      最近更新 更多