Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-braintree-drop-in-module
Advanced tools
Readme
React Native integration of Braintree Drop-in
yarn add react-native-braintree-payments-drop-in
# Run this only if you are on RN < 0.60
react-native link react-native-braintree-payments-drop-in
You must have a iOS deployment target >= 9.0.
If you don't have a Podfile or are unsure on how to proceed, see the CocoaPods usage guide.
In your Podfile
, add:
# uncomment the next line if you are on RN < 0.60
#pod 'BraintreeDropIn', '~> 7.5.0'
# uncomment the next line to support credit card scanning
# pod 'CardIO'
Then:
cd ios
bundle exec pod repo update # optional and can be very long
bundle exec pod install
If you want to add card scanning, add in your app/build.gradle
:
dependencies {
...
implementation "io.card:android-sdk:5.+"
For more configuration options, see Braintree's documentation (iOS | Android).
If you plan on using 3D Secure, you have to do the following.
Add a bundle url scheme {BUNDLE_IDENTIFIER}.payments
in your app Info via XCode or manually in the Info.plist
.
In your Info.plist
, you should have something like:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.myapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.myapp.payments</string>
</array>
</dict>
</array>
In your AppDelegate.m
:
#import "BraintreeCore.h"
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
[BTAppSwitch setReturnURLScheme:self.paymentsURLScheme];
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
if ([url.scheme localizedCaseInsensitiveCompare:self.paymentsURLScheme] == NSOrderedSame) {
return [BTAppSwitch handleOpenURL:url options:options];
}
return [RCTLinkingManager application:application openURL:url options:options];
}
- (NSString *)paymentsURLScheme {
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
return [NSString stringWithFormat:@"%@.%@", bundleIdentifier, @"payments"];
}
Setup browser switch.
For the API, see the Flow typings.
import BraintreeDropIn from 'react-native-braintree-payments-drop-in';
BraintreeDropIn.show({
clientToken: 'CLIENT_TOKEN_GENERATED_ON_SERVER_SIDE',
totalPrice: '1.0',
currencyCode: 'EUR',
GPayMerchantId: 'GPAY_MERCHANT_ID',
companyName: 'COMPANY_NAME',
disabledVaultManager: false,
})
.then(result => console.log(result))
.catch((error) => {
if (error.code === 'USER_CANCELLATION') {
// update your UI to handle cancellation
} else {
// update your UI to handle other errors
}
});
import BraintreeDropIn from 'react-native-braintree-payments-drop-in';
BraintreeDropIn.show({
clientToken: 'CLIENT_TOKEN_GENERATED_ON_SERVER_SIDE',
totalPrice: '1.0',
currencyCode: 'EUR',
GPayMerchantId: 'GPAY_MERCHANT_ID',
companyName: 'COMPANY_NAME',
threeDSecure: {
amount: 1.0,
},
disabledVaultManager: false,
})
.then(result => console.log(result))
.catch((error) => {
if (error.code === 'USER_CANCELLATION') {
// update your UI to handle cancellation
} else {
// update your UI to handle other errors
// for 3D secure, there are two other specific error codes: 3DSECURE_NOT_ABLE_TO_SHIFT_LIABILITY and 3DSECURE_LIABILITY_NOT_SHIFTED
}
});
FAQs
React Native integration of Braintree Drop-in
The npm package react-native-braintree-drop-in-module receives a total of 1 weekly downloads. As such, react-native-braintree-drop-in-module popularity was classified as not popular.
We found that react-native-braintree-drop-in-module demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.