【问题标题】:Retrieve Braintree Customer ID检索 Braintree 客户 ID
【发布时间】:2018-04-23 21:41:00
【问题描述】:

如何使用 Braintree 从我的销售结果中检索客户 ID。我能够获得交易 ID,但我不完全理解结果。谢谢

$result = $gateway->transaction()->sale($sale);

if ($result->success){

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

    $btree_transacton_id = $result->transaction->id;

    echo "Braintree Customer ID : ".$btree_cust_id." Transaction ID: ".$btree_transacton_id; 
}

【问题讨论】:

    标签: braintree


    【解决方案1】:

    全面披露:我在 Braintree 工作。如果您还有任何问题,请随时联系support

    根据Braintree developer docsTransaction result object 有一个customerDetails 属性,它本身也有一个id 属性。

    因此,您可以使用 $result->transaction->customerDetails->id 检索客户 ID。

    【讨论】:

    • 谢谢Shea,我现在明白了。谢谢
    • 使用沙盒时,好像没有定义customerDerails
    猜你喜欢
    • 2013-04-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-24
    • 2015-01-15
    • 1970-01-01
    • 2018-08-26
    • 2015-02-14
    • 2016-02-04
    相关资源
    最近更新 更多