dtest84004 2019-08-13 09:21
浏览 43

如何在braintree GRANT API php中获取付款方式令牌

I am using braintree grant api to have access of client transaction. I am going through all the documentation and followed the example and have oAuth ready from my side.

this is my oAuth.php

$gateway = new Braintree_Gateway([
   'clientId'=>'client_id',
   'clientSecret' => 'client_secret'
]);

with the help of this, I created the connect with braintree button. Once authorized by the receiver, I get a code which I used to created access token.

$result = $gateway->oauth()->createTokenFromCode([
    'code' => $code
]);

In the $result variable I get an access token. Now as per the document, I need to generate Nonce and provide that nonce to receiver.

Code is given in the example

$grantResult = $gateway->paymentMethod()->grant(
   'the_payment_method_token',
   ['allowVaulting' => false, 'includeBillingPostalCode' => true]
);
$nonceToSendToRecipient = $grantResult->paymentMethodNonce->nonce;

Document is suggesting that i will get the_payment_method_token from the vault.

1: But Do i need to go to vault and manually copy paste the token OR is there any way I can get the token from the code dynamically.

2: How do I give only those nonce which are particular for receiver? My braintree account has many receiver connected and I don't want to share all the transaction details with them.

Please help!!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大