Setup and Integration
Starting October 1, 2026, the Drop-in SDK will be deprecated. No new features, improvements, or bug fixes will be released after this date. Payment processing will continue to be supported until October 1, 2027, but we strongly recommend migrating to the Braintree SDK as soon as possible to avoid future disruption.
Starting October 1, 2027, the Drop-in SDK will become unsupported. Braintree support team will no longer provide assistance for this SDK, and payment processing may be suspended at any time.
Action required: Migrate to the Braintree Android SDK to continue processing payments and receive ongoing updates, security fixes, and support.
Configuration
To use the Drop-in UI, you'll need to get a tokenization key from the Control Panel or you can generate a client token on your server.
Setup
Gradle
Use Gradle to integrate with the Braintree Android SDK.
In your app's build.gradle, add the following:
Client-side implementation
Starting Drop-in
Configuring payment methods
Additional steps are required for the Drop-in UI to accept payment methods other than cards. After completing the Drop-in setup instructions, follow the steps below for each payment method type.
Google Pay
In order for Drop-in to support Google Pay, you must ensure you've added the required meta-data tag in your AndroidManifest.xml.
If using a client token with a customer id, the Google Pay card will not automatically be vaulted. You can use the payment method nonce to create a payment method on your server.
Venmo
To support Venmo payments in the Drop-in UI, make sure to follow the browser switch setup instructions in the Client SDK Setup.
Construct a VenmoRequest, and add it to your DropInRequest:
- Java
- Kotlin
VenmoRequest venmoRequest = new VenmoRequest(VenmoPaymentMethodUsage.MULTI_USE);
dropInRequest.setVenmoRequest(venmoRequest);3D Secure
Drop-in supports 3D Secure verification. To use 3D Secure in your integration, construct a ThreeDSecureRequest with an amount and add it to your DropInRequest :
Displaying the most recently added payment method
If your user already has an existing payment method, you may not need to
show Drop-in. You can check if they have an existing payment method using
DropInClient#fetchMostRecentPaymentMethod. A payment method
will only be returned when using a client token created with a
customer_id.
- Java
- Kotlin
DropInClient dropInClient = new DropInClient(this, new ExampleClientTokenProvider());
dropInClient.fetchMostRecentPaymentMethod(this, (dropInResult, error) -> {
if (error != null) {
// an error occurred
} else if (dropInResult != null) {
if (dropInResult.getPaymentMethodType() != null) {
DropInPaymentMethod paymentMethodType = dropInResult.getPaymentMethodType();
// use the icon and name to show in your UI
int icon = paymentMethodType.getDrawable();
int name = paymentMethodType.getLocalizedName();
if (paymentMethodType == DropInPaymentMethod.GOOGLE_PAY) {
// The last payment method the user used was Google Pay.
// The Google Pay flow will need to be performed by the
// user again at the time of checkout.
} else {
// Use the payment method show in your UI and charge the user
// at the time of checkout.
PaymentMethodNonce paymentMethod = dropInResult.getPaymentMethodNonce();
}
} else {
// there was no existing payment method
}
}
});Browser Switch
The Drop-in, in most cases, handles browser switching internally. Specifying
an <intent-filter /> in
AndroidManifest.xml is most often no longer required. Any
payment method that requires a browser switch will work automatically.
On the other hand, there are some scenarios that will require you to set a
custom URL scheme for browser switch deep linking. For example, if your
applicationId contains uppercase letters, you will need to
override the default deep link configuration set by the DropIn library.
Internally we use a manifest placeholder to support deep linking into
DropInActivity. You can override the deep link intent filter
for DropInActivity by placing the following xml snippet in your
app's AndroidManifest.xml:
- XML
<activity android:name="com.braintreepayments.api.DropInActivity" android:exported="true" tools:node="merge">
<intent-filter tools:node="removeAll" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="my-custom-url-scheme" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
You can then set the custom url scheme on DropInRequest to
align with the overridden AndroidManifest.xml value:
- Java
- Kotlin
dropInRequest.setCustomUrlScheme("my-custom-url-scheme");Once set, the DropIn SDK will use this custom url scheme when deep linking instead of the default one.
Next steps
- Read the Set Up Your Server guide to learn about our server SDKs and how to send a nonce to your server
- Explore the ways to customize the appearance and functionality of Drop-in
- Learn how to manage different payment methods
Next Page: Customization →