{"id":22830769,"url":"https://github.com/braintree/braintree-android-drop-in","last_synced_at":"2025-05-16T06:07:18.553Z","repository":{"id":11778176,"uuid":"67063608","full_name":"braintree/braintree-android-drop-in","owner":"braintree","description":"Braintree Drop-In SDK for Android","archived":false,"fork":false,"pushed_at":"2025-04-18T19:50:03.000Z","size":32246,"stargazers_count":124,"open_issues_count":30,"forks_count":81,"subscribers_count":68,"default_branch":"main","last_synced_at":"2025-04-19T06:35:43.975Z","etag":null,"topics":["android","braintree","drop-in","payments","sdk","ui"],"latest_commit_sha":null,"homepage":"https://developers.braintreepayments.com/guides/drop-in/android/v2","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/braintree.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-31T18:35:25.000Z","updated_at":"2025-02-12T08:16:08.000Z","dependencies_parsed_at":"2024-01-08T19:58:45.654Z","dependency_job_id":"88f62a05-eccf-449a-be25-c58ceb51cea1","html_url":"https://github.com/braintree/braintree-android-drop-in","commit_stats":null,"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braintree%2Fbraintree-android-drop-in","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braintree%2Fbraintree-android-drop-in/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braintree%2Fbraintree-android-drop-in/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/braintree%2Fbraintree-android-drop-in/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/braintree","download_url":"https://codeload.github.com/braintree/braintree-android-drop-in/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478190,"owners_count":22077676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","braintree","drop-in","payments","sdk","ui"],"created_at":"2024-12-12T20:14:28.008Z","updated_at":"2025-05-16T06:07:13.540Z","avatar_url":"https://github.com/braintree.png","language":"Java","funding_links":["https://developer.paypal.com/braintree/docs/guides/client-sdk/deprecation-policy/android/v4","https://developer.paypal.com/braintree/docs/guides/authorization/overview","https://developer.paypal.com/braintree/docs/guides/3d-secure/configuration","https://developer.paypal.com/braintree/docs/guides/3d-secure/migration/android/v4","https://developer.paypal.com/braintree/docs/guides/drop-in/overview/android/v4","https://developer.paypal.com/braintree/articles","https://developer.paypal.com/braintree/help"],"categories":[],"sub_categories":[],"readme":"# Braintree Android Drop-In\n\n[![Tests](https://github.com/braintree/braintree-android-drop-in/actions/workflows/tests.yml/badge.svg)](https://github.com/braintree/braintree-android-drop-in/actions/workflows/tests.yml)\n\nBraintree Android Drop-In is a readymade UI that allows you to accept card and alternative payments in your Android app.\n\n\u003cimg alt=\"Screenshot of Drop-In\" src=\"screenshots/vaulted-payment-methods.png\" width=\"200\"/\u003e\n\n## 📣 Announcements\n- A new major version of the SDK is now available. See the [v6 migration guide](v6_MIGRATION_GUIDE.md) for details.\n- Upgrade your integration to continue accepting Braintree payments The SSL certificates for the Android SDK are set to expire by June 31, 2025. Upgrade to v6.16.0+ to continue using the Braintree SDK.\n\n## Adding it to your project\n\nAdd the dependency in your `build.gradle`:\n\n```groovy\ndependencies {\n  implementation 'com.braintreepayments.api:drop-in:6.16.0'\n}\n```\n\nAdditionally, add the following Maven repository and (non-sensitive) credentials to your app-level gradle:\n\n```groovy\nrepositories {\n    maven {\n        url \"https://cardinalcommerceprod.jfrog.io/artifactory/android\"\n        credentials {\n            username 'braintree_team_sdk'\n            password 'cmVmdGtuOjAxOjIwMzgzMzI5Nzg6Q3U0eUx5Zzl5TDFnZXpQMXpESndSN2tBWHhJ'\n        }\n    }\n}\n```\n\nTo preview the latest work in progress builds, add the following SNAPSHOT dependency in your `build.gradle`:\n\n```groovy\ndependencies {\n  implementation 'com.braintreepayments.api:drop-in:6.16.1-SNAPSHOT'\n}\n```\n\nYou will also need to add the Sonatype snapshots repo to your top-level `build.gradle` to import SNAPSHOT builds:\n\n```groovy\nallprojects {\n    repositories {\n        maven {\n            url 'https://oss.sonatype.org/content/repositories/snapshots/'\n        }\n    }\n}\n```\n\n## Versions\n\nThis SDK abides by our Client SDK Deprecation Policy. For more information on the potential statuses of an SDK, check our [developer docs](https://developer.paypal.com/braintree/docs/guides/client-sdk/deprecation-policy/android/v4).\n\n| Major version number | Status | Released | Deprecated | Unsupported |\n| -------------------- | ------ | -------- | ---------- | ----------- |\n| 6.x.x | Active | November 2021 | TBA | TBA |\n| 5.x.x | Unsupported | September 2020 | November 2022 | November 2023 |\n| 4.x.x | Unsupported | February 2019 | September 2021 | September 2022 |\n\nVersions 3 and below are unsupported.\n\n## Usage\n\nCreate a `DropInRequest` to start the Drop-in UI with specified options:\n\n```kotlin\nval dropInRequest = DropInRequest()\n```\n\n`DropInClient` is responsible for launching the Drop-in UI. To launch Drop-in, instantiate a `DropInClient` with [client authorization](https://developer.paypal.com/braintree/docs/guides/authorization/overview) and call `DropInClient#launchDropInForResult` with the `DropInRequest` you configured above and a request code that you have defined for Drop-in:\n\n```kotlin\nval dropInClient = DropInClient(this, \"\u003c#CLIENT_AUTHORIZATION#\u003e\")\ndropInClient.setListener(this)\ndropInClient.launchDropIn(dropInRequest)\n```\n\nTo handle the result of the Drop-in flow, implement `DropInListener` methods `onDropInSuccess()` and `onDropInFailure()`:\n\n```kotlin\noverride fun onDropInSuccess(result: DropInResult) {\n  // use the result to update your UI and send the payment method nonce to your server\n  val paymentMethodNonce = result.paymentMethodNonce?.string\n}\n\noverride fun onDropInFailure(error: Exception) {\n  // an error occurred, checked the returned exception\n}\n```\n\n### Localization\n\nDrop-In is currently localized for [25 languages](https://github.com/braintree/braintree-android-drop-in/tree/main/Drop-In/src/main/res). To view localized text for a specific locale, open its corresponding `values-\u003cLOCALE_NAME\u003e/strings.xml` resource file.\n\n### 3D Secure + Drop-in\n\nDrop-In supports 3D-Secure verification. Assuming you have [3D-Secure configured](https://developer.paypal.com/braintree/docs/guides/3d-secure/configuration) for your account, create a ThreeDSecureRequest() object, setting `ThreeDSecurePostalAddress` and `ThreeDSecureAdditionalInformation` fields where possible; the more fields that are set, the less likely a user will be presented with a challenge. For more information, check our [3D Secure Migration Guide](https://developer.paypal.com/braintree/docs/guides/3d-secure/migration/android/v4#getting-ready-for-3ds-2). Make sure to attach this object to the `BTDropInRequest` before use.\n\n```kotlin\nval address = ThreeDSecurePostalAddress()\naddress.givenName = \"Jill\" // ASCII-printable characters required, else will throw a validation error\naddress.surname = \"Doe\" // ASCII-printable characters required, else will throw a validation error\naddress.phoneNumber = \"5551234567\"\naddress.streetAddress = \"555 Smith St\"\naddress.extendedAddress = \"#2\"\naddress.locality = \"Chicago\"\naddress.region = \"IL\"\naddress.postalCode = \"12345\"\naddress.countryCodeAlpha2 = \"US\"\n\n// Optional additional information.\n// For best results, provide as many additional elements as possible.\nval additionalInformation = ThreeDSecureAdditionalInformation()\nadditionalInformation.shippingAddress = address\n\nval threeDSecureRequest = ThreeDSecureRequest()\nthreeDSecureRequest.amount = \"1.00\"\nthreeDSecureRequest.email = \"test@email.com\"\nthreeDSecureRequest.billingAddress = address\nthreeDSecureRequest.versionRequested = VERSION_2\nthreeDSecureRequest.additionalInformation = additionalInformation\n\nval dropInRequest = DropInRequest()\ndropInRequest.threeDSecureRequest = threeDSecureRequest\n```\n\n### Fetch last used payment method\n\nIf 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`.\n\n```kotlin\nval dropInClient = DropInClient(this, \"\u003c#CLIENT_TOKEN_WITH_CUSTOMER_ID\u003e\", dropInRequest)\ndropInClient.fetchMostRecentPaymentMethod(this) { dropInResult, error -\u003e\n    error?.let {\n        // an error occurred\n    }\n    dropInResult?.let { result -\u003e\n        result.paymentMethodType?.let { paymentMethodType -\u003e\n            // use the icon and name to show in your UI\n            val icon = paymentMethodType.drawable\n            val name = paymentMethodType.localizedName\n\n            if (paymentMethodType == DropInPaymentMethod.GOOGLE_PAY) {\n                // The last payment method the user used was Google Pay.\n                // The Google Pay flow will need to be performed by the\n                // user again at the time of checkout.\n            } else {\n                // Show the payment method in your UI and charge the user\n                // at the time of checkout.\n                val paymentMethod = result.paymentMethodNonce\n            }\n        }\n    } ?: run {\n        // there was no existing payment method\n    }\n}\n```\n\n## Help\n\n* [Read the javadocs](https://braintree.github.io/braintree-android-drop-in/)\n* [Read the docs](https://developer.paypal.com/braintree/docs/guides/drop-in/overview/android/v4)\n* Find a bug? [Open an issue](https://github.com/braintree/braintree-android-drop-in/issues)\n* Want to contribute? [Check out contributing guidelines](CONTRIBUTING.md) and [submit a pull request](https://help.github.com/articles/creating-a-pull-request).\n\n## Feedback\n\nHere are a few ways to get in touch:\n\n* [GitHub Issues](https://github.com/braintree/braintree-android-drop-in/issues) - For generally applicable issues and feedback\n* [Braintree Support](https://developer.paypal.com/braintree/articles) / [Get Help](https://developer.paypal.com/braintree/help) -\nfor personal support at any phase of integration\n\n## License\n\nBraintree Android Drop-In is open source and available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraintree%2Fbraintree-android-drop-in","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraintree%2Fbraintree-android-drop-in","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraintree%2Fbraintree-android-drop-in/lists"}