Stripe Android SDK
The Stripe Android SDK makes it quick and easy to build an excellent payment experience in your Android app. We provide powerful and customizable UI elements that can be used out-of-the-box to collect your users' payment details. We also expose the low-level APIs that power those UIs so that you can build fully custom experiences.
Get started with our
Updating to a newer version of the SDK? See our migration guide and changelog.
Table of contents
Installation
Requirements
- Android 5.0 (API level 21) and above
- Android Gradle Plugin 3.5.1
- Gradle 5.4.1+
- AndroidX (as of v11.0.0)
Configuration
Add stripe-android
to your build.gradle
dependencies.
dependencies {
implementation 'com.stripe:stripe-android:16.1.1'
}
Releases
- The changelog provides a summary of changes in each release.
- The migration guide provides instructions on upgrading from older versions.
Proguard
The Stripe Android SDK will configure your app's Proguard rules using proguard-rules.txt.
Features
Simplified Security: Use the SDK to collect credit card numbers and remain PCI compliant. This means sensitive data is sent directly to Stripe instead of passing through your server. For more information, see our Integration Security Guide.
Google Pay: Stripe is fully compatible with Google Pay.
Stripe API: We provide low-level APIs that correspond to objects and methods in the Stripe API. You can build your own entirely custom UI on top of this layer.
SCA-Ready: The SDK automatically performs native 3D Secure authentication to comply with Strong Customer Authentication regulation in Europe.
Native UI: We provide native screens and elements to collect payment and shipping details. For example, CardInputWidget is a view that collects and validates card details. You can use these individually, or take all of the prebuilt UI in one flow by following the Basic Integration guide.
Getting Started
Get started with our
The Stripe
class is the entry-point to the Stripe SDK. It must be instantiated with a Stripe publishable key.
When testing, you can use a test publishable key. Remember to replace the test key with your live key in production. You can view your API keys in the Stripe Dashboard.
new Stripe(context, "pk_test_yourkey");
Examples
- Accept a card payment (PaymentIntents API)
- Save a card without payment (SetupIntents API)
- Accept a card payment (Charges API)
- The stripe-samples/sample-store-android repo demonstrates how to build a payment flow using our prebuilt UI components (Basic Integration)
- The example project demonstrates using our API bindings and UI components, including how to create Tokens, Sources, and Payment Methods; how to use the Stripe class's synchronous and asynchronous methods; and how to use the CardInputWidget.