{"id":27151390,"url":"https://github.com/checkout/checkout-risk-sdk-android","last_synced_at":"2025-06-15T17:09:35.522Z","repository":{"id":220503333,"uuid":"703532808","full_name":"checkout/checkout-risk-sdk-android","owner":"checkout","description":"The Risk Android package helps collect device data for merchants with direct integration (standalone) with the package and those using Checkout's Frames Android package.","archived":false,"fork":false,"pushed_at":"2025-04-23T16:40:43.000Z","size":302,"stargazers_count":1,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T02:42:03.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/checkout.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2023-10-11T12:21:57.000Z","updated_at":"2025-04-23T16:38:07.000Z","dependencies_parsed_at":"2024-04-25T17:27:50.604Z","dependency_job_id":"f1d5339f-a9f5-495f-97f8-6201cd096f9a","html_url":"https://github.com/checkout/checkout-risk-sdk-android","commit_stats":null,"previous_names":["checkout/checkout-risk-sdk-android"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/checkout/checkout-risk-sdk-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-risk-sdk-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-risk-sdk-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-risk-sdk-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-risk-sdk-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/checkout","download_url":"https://codeload.github.com/checkout/checkout-risk-sdk-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-risk-sdk-android/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260016052,"owners_count":22946320,"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":[],"created_at":"2025-04-08T14:40:17.117Z","updated_at":"2025-06-15T17:09:35.477Z","avatar_url":"https://github.com/checkout.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  Risk Android package\n[![](https://jitpack.io/v/checkout/checkout-risk-sdk-android.svg)](https://jitpack.io/#checkout/checkout-risk-sdk-android)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\nThe package helps collect device data for merchants with direct integration (standalone) with the package and those using [Checkout's Frames Android package](https://github.com/checkout/frames-android).\n\n## Table of contents\n- [Risk Android package](#risk-android-package)\n  - [Table of contents](#table-of-contents)\n  - [Requirements](#requirements)\n  - [Documentation](#documentation)\n    - [Usage guide](#usage-guide)\n    - [Public API](#public-api)\n    - [Additional Resources](#additional-resources)\n  - [Demo projects](#demo-projects)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n\n## Requirements\n- Android minimum SDK 21\n\n\u003e Compatibility verified with `targetSdk` versions 21 to 33\n\n## Documentation\n### Usage guide\n  1. Add JitPack repository to the project level build.gradle file:\n        ```\n        // project gradle file\n        allprojects {\n            repositories {\n                maven { url 'https://jitpack.io' }\n                maven { url = uri(\"https://maven.fpregistry.io/releases\") }\n            }\n        }\n        ```\n  2. Add Risk SDK dependency to the module gradle file:\n        ```\n        // module gradle file\n        dependencies {\n            implementation 'com.github.checkout:checkout-risk-sdk-android:\u003clatest_version\u003e'\n        }\n        ```\n\n        \u003e You can find more about the installation and available versions on [![](https://jitpack.io/v/checkout/checkout-risk-sdk-android.svg)](https://jitpack.io/#checkout/checkout-risk-sdk-android)\n\n        \u003e Please keep in mind that the Jitpack repository should to be added to the project gradle file while the dependency should be added in the module gradle file. (More about build configuration files is available [here](https://developer.android.com/studio/build)).\n\n  3. Obtain a public API key from [Checkout Dashboard](https://dashboard.checkout.com/developers/keys).\n  4. Initialise the package with the `getInstance` method passing in the required configuration (public API key and environment) early-on.\n        ```kotlin\n        // Example usage of package\n        val yourConfig = RiskConfig(publicKey = \"pk_qa_xxx\", environment = RiskEnvironment.QA)\n        // Initialise the package with the getInstance method early-on\n        val riskInstance =\n            Risk.getInstance(\n                context,\n                RiskConfig(\n                    BuildConfig.SAMPLE_MERCHANT_PUBLIC_KEY,\n                    RiskEnvironment.QA,\n                    false,\n                ),\n            ).let {\n                it?.let {\n                    it\n                } ?: run {\n                    null\n                }\n            }\n\n        ```\n   5. When the shopper selects Pay, publish the device data with the `publishData` method on the Risk instance and retrieve the `deviceSessionId`.\n        ```kotlin\n        // Publish the device data with the publishData method\n        riskInstance?.publishData().let {\n            if (it is PublishDataResult.Success) {\n                println(\"Device session ID: ${it.deviceSessionId}\") // dsid_XXXX\n            }\n        }\n        ```\n\n### Public API\nThe package exposes two methods:\n1. `getInstance` - This method returns a singleton instance of Risk. When the method is called, preliminary checks are made to Checkout's internal API(s) that retrieve the public keys used to initialise the package for collecting device data. If the checks fail or the merchant is disabled, `null` will be returned, else, if the checks are successful, the `Risk` instance is returned to the consumer of the package which can now be used to publish the data with the `publishData` method.\n\n    \u003cdetails\u003e\n    \u003csummary\u003eArguments\u003c/summary\u003e\n\n    ```kotlin\n    data class RiskConfig(val publicKey: String, val environment: RiskEnvironment, val framesMode: Boolean = false)\n\n    // Instance creation of Risk Android package\n    public class Risk private constructor(...) {\n        public companion object {\n            ...\n            public suspend fun getInstance(applicaitonContext: Context, config: RiskConfig): Risk? {\n                ...\n            }\n        }\n    }\n\n    enum class RiskEnvironment {\n        QA,\n        SANDBOX,\n        PROD\n    }\n    ```\n    \u003c/details\u003e\n\n    \u003cdetails\u003e\n    \u003csummary\u003eResponses\u003c/summary\u003e\n\n    ```kotlin\n    class Risk private constructor(...) {\n        companion object {\n            ...\n            suspend fun publishData(...): ... {\n                ...\n            }\n        }\n    }\n    ```\n    \u003c/details\u003e\n\n\n2. `publishData` - This is used to publish and persist the device data.\n\n    \u003cdetails\u003e\n    \u003csummary\u003eArguments\u003c/summary\u003e\n\n    ```kotlin\n    public suspend fun publishData(cardToken: String? = null): PublishDataResult {\n    ...\n    }\n    ```\n    \u003c/details\u003e\n\n    \u003cdetails\u003e\n    \u003csummary\u003eResponses\u003c/summary\u003e\n\n    ```kotlin\n        public sealed class PublishDataResult {\n            public data class Success(val deviceSessionId: String) : PublishDataResult()\n\n            public data object PublishFailure : PublishDataResult()\n        }\n    ```\n    \u003c/details\u003e\n\n### Additional Resources\n\u003c!-- TODO: Add website documentation link here - [Risk Android SDK documentation](https://docs.checkout.com/risk/overview) --\u003e\n- [Frames Android SDK documentation](https://www.checkout.com/docs/developer-resources/sdks/frames-android-sdk)\n\n## Demo projects\nOur sample application showcases our prebuilt UIs and how our SDK works. You can run this locally e.g. with Android Studio after adding your public key as an environment variable. See steps below:\n- Add environment variable: For example if your public key is `pk_test_123` you would add the following to your `~/.bash_profile` or `~/.zshrc` file:\n`export SAMPLE_MERCHANT_PUBLIC_KEY=pk_test_123`.\n- Once you clone the repository, open it in Android Studio and click on the Run button.\n\n## Contributing\nFind our guide to start contributing [here](https://github.com/checkout/checkout-risk-sdk-android/blob/main/CONTRIBUTING.md).\n\n## License\nRisk Android is released under the MIT license. [See LICENSE](https://github.com/checkout/checkout-risk-sdk-android/blob/main/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckout%2Fcheckout-risk-sdk-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheckout%2Fcheckout-risk-sdk-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckout%2Fcheckout-risk-sdk-android/lists"}