检索 Braintree 客户 ID
Retrieve Braintree Customer ID
如何使用 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 工作。如果您有任何其他问题,请随时联系 support.
根据 Braintree developer docs, a Transaction result object has a customerDetails
attribute which itself has an id
属性。
因此,您可以使用 $result->transaction->customerDetails->id
检索客户 ID。
如何使用 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 工作。如果您有任何其他问题,请随时联系 support.
根据 Braintree developer docs, a Transaction result object has a customerDetails
attribute which itself has an id
属性。
因此,您可以使用 $result->transaction->customerDetails->id
检索客户 ID。