
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-native-braintree-sdk
Advanced tools
A small wrapper to access Braintree's most recent iOS/Android SDK on React Native
A small wrapper to access Braintree's most recent iOS/Android SDK on React Native
npm install react-native-braintree-sdk
import * as Braintree from "react-native-braintree-sdk";
// ...
const App = () => {
const [isApplePayAvailable, setIsApplePayAvailable] = React.useState(false);
useEffect(() => {
const setup = async () => {
await Braintree.setup('clientToken');
Braintree.isApplePayAvailable()
.then(setIsApplePayAvailable)
.catch(showError);
}
}, []);
const onPressApplePay = React.useCallback(async () => {
try {
const result = await Braintree.authorizeApplePay({
merchantId: 'test-merchant-id',
lineItems: [
{
label: 'Total',
amount: 10,
},
],
contactFields: ['postalAddress'],
supportedNetworks: ['AmEx', 'Visa', 'MasterCard'],
});
Alert.alert('Apple Pay Result', `Nonce: ${result.nonce}`);
} catch (error) {
showError(error);
}
}, []);
return (
<View>
{isApplePayAvailable && <Button title='Pay with Venmo' onPress={onPressApplePay} />}
</View>
);
}
voidSets up the native Braintree client
| Param | Type | Description |
|---|---|---|
| clientAuthorization | string | See Braintre's Docs |
Promise<boolean>Checks if the device can launch Venmo on iOS, on Android always returns true
Returns: Promise - Promise resolving to the status
Promise<VenmoResponse>Asks the user to start a Venmo request, if the user approves, returns a nonce to use for a transaction
Returns: Promise.<VenmoResponse> - Promise resolving to nonce and the user's venmo username
| Param | Type | Description |
|---|---|---|
| params | AuthorizeVenmoParams | See Braintre's Docs to find out more on the use / vaulting options |
Promise<boolean>Checks if the device can use Google Pay. Always returns false on iOS devices
Returns: Promise - Promise resolving to the status
Promise<NonceResponse>Presents the Google Pay popup, if the user approves, returns a nonce to use for a transaction
Returns: Promise.<NonceResponse> - Promise resolving to nonce
| Param | Type | Description |
|---|---|---|
| params | AuthorizeGooglePayParams | The price for the transaction that the nonce will be used with |
Promise<boolean>Checks if the device can use Apple Pay. Always returns false on Android devices
Returns: Promise - Promise resolving to the status
Promise<NonceResponse>Presents the Apple Pay popup, if the user approves, returns a nonce to use for a transaction
Returns: Promise.<NonceResponse> - Promise resolving to nonce
| Param | Type | Description |
|---|---|---|
| params | AuthorizeGooglePayParams | See Braintre's Docs to learn more about the Apple Pay payment request options |
Promise<CardResponse>Creates a nonce for a card
Returns: Promise.<CardResponse> - Promise resolving to nonce and card informatiom
| Param | Type | Description |
|---|---|---|
| card | CardDetails | The card details you collect on the device |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
A small wrapper to access Braintree's most recent iOS/Android SDK on React Native
We found that react-native-braintree-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.