0
從Braintree_PaymentMethod :: create中讀取返回對象的正確方法是什麼? 我想訪問自動生成的令牌。如何從Braintree_PaymentMethod :: create中讀取標記
我這樣做目前: $result = $output->paymentMethod->_attributes['token']
的布倫特裏文檔中我找不到它。
從Braintree_PaymentMethod :: create中讀取返回對象的正確方法是什麼? 我想訪問自動生成的令牌。如何從Braintree_PaymentMethod :: create中讀取標記
我這樣做目前: $result = $output->paymentMethod->_attributes['token']
的布倫特裏文檔中我找不到它。
以下是演示如何從成功的付款方式創建中檢索令牌的代碼片段。
$result = Braintree_PaymentMethod::create(array(
'customerId' => 'existing-customer',
'paymentMethodNonce' => 'valid-nonce'
));
$token = $result->paymentMethod->token;