我正在开发最新的React-native应用程序。我已经尝试将Braintree集成到使用该库的随机数中。该库很旧,没有错误,我也没有得到答复。
库链接: react-native-braintree-xplat
我已附上我的代码,
import React, { PureComponent } from 'react';
import { Button } from 'react-native';
import BTClient from 'react-native-braintree-xplat';
class paymentMethod extends PureComponent {
componentDidMount() {
let token = 'braintree_tokenization_key';
BTClient.setup(token);
}
getCardToken(){
const card = {
number: '4111111111111111',
expirationDate: '10/2023',
cvv: '123',
}
BTClient.getCardNonce(card).then(function (nonce) {
console.log(nonce, 'nonce');
}).catch(function (err) {
console.log(err, 'err');
});
}
render(){
return (
<Button onPress={()=>getCardToken()} > Card Token </Button>
)
}
}
export default paymentMethod;
告诉我,如何整合大脑树以获得卡片随机数?