{"id":32294284,"url":"https://github.com/xendit/cards-session-mobile-sdk","last_synced_at":"2026-07-19T09:35:21.185Z","repository":{"id":272890928,"uuid":"884043245","full_name":"xendit/cards-session-mobile-sdk","owner":"xendit","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-01T14:55:16.000Z","size":383,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-07-01T11:18:34.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xendit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-06T03:09:38.000Z","updated_at":"2025-10-01T14:55:21.000Z","dependencies_parsed_at":"2025-01-17T09:20:37.157Z","dependency_job_id":"c98c71e4-c6e0-44a1-a12f-07e61a4f27bf","html_url":"https://github.com/xendit/cards-session-mobile-sdk","commit_stats":null,"previous_names":["xendit/cards-session-mobile-sdk"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/xendit/cards-session-mobile-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fcards-session-mobile-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fcards-session-mobile-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fcards-session-mobile-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fcards-session-mobile-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xendit","download_url":"https://codeload.github.com/xendit/cards-session-mobile-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xendit%2Fcards-session-mobile-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35649096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-19T02:00:06.923Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-23T03:42:32.179Z","updated_at":"2026-07-19T09:35:21.179Z","avatar_url":"https://github.com/xendit.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xendit Cards SDK\n\nA lightweight SDK for integrating card payments into Android and iOS applications. This SDK provides secure card data collection functionality with built-in validation and 3DS support.\n\n## Features\n\n- Secure card data collection\n- CVN/CVV collection\n- 3DS support\n- Automatic card validation\n- Support for both one-time payments and saved cards\n\n## Installation\n\n### Android - Gradle\n\nAdd the following to your app's `build.gradle.kts`:\n\n```kotlin\ndependencies {\n    implementation(\"com.xendit:cardsSdk:1.1.0\")\n}\n```\n\n### iOS - Cocoapod\n\nAdd the following to your app's `Podfile`:\n\n```ruby\npod 'CardSessionMobileSDK', '~\u003e 1.1.0'\n```\n\n**Important:** Import SDK in your project with CocoaPods integration, you can do as following\n\n```swift\nimport cardsSdk\n```\n### iOS - Swift Package Manager\n\nIn XCode go to `File` -\u003e `Add Packages...` and provide URL to this repository in the search bar. Choose `Dependency Role` and select apropriate project. \n\n**Important:** Import SDK in your project with Swift Package Manager integration, you can do as following\n\n```swift\nimport cardsSdk\n```\n\n### Flutter\n\nUse the [Flutter Package](https://pub.dev/packages/xendit_cards_session).\n\n### React Native\n\nUse xendit's card-sessions-js.\n\n## Usage\n\n### Initialize the SDK\n\n#### Android\n```kotlin\nval cardSessions = CardSessions.create(\n    context = context,\n    apiKey = \"xnd_public_development_YOUR_KEY_HERE\"\n)\n```\n\n#### iOS\n```swift\nlet cardSessions = CardSessionsFactory().create(\n    apiKey: \"xnd_public_development_YOUR_KEY_HERE\"\n)\n```\n\n### Collect Card Data\n\n#### Android\n```kotlin\n// Collect complete card information\nval response = cardSessions.collectCardData(\n    cardNumber = \"4000000000001091\",\n    expiryMonth = \"12\",\n    expiryYear = \"2025\",\n    cvn = \"123\", // Optional\n    cardholderFirstName = \"John\",\n    cardholderLastName = \"Doe\",\n    cardholderEmail = \"john@example.com\",\n    cardholderPhoneNumber = \"+1234567890\",\n    paymentSessionId = \"ps-1234567890\", // Session ID from your backend\n    confirmSave = true, // Optional, default to false\n    billingInformation = BillingInformationDto( // Optional\n        firstName = \"Budi\",\n        lastName = \"Santoso\",\n        email = \"budi@example.co.id\",\n        phoneNumber = \"+6281234567890\",\n        streetLine1 = \"Jl. Jend. Sudirman No.Kav 48A\",\n        streetLine2 = \"\",\n        city = \"San Francisco\",\n        provinceState = \"CA\",\n        country = \"US\",\n        postalCode = \"94107\"\n    )\n)\n```\n\n#### iOS\n```swift\n// Using async/await\nlet response = try await cardSessions.collectCardData(\n    cardNumber: \"4000000000001091\",\n    expiryMonth: \"12\",\n    expiryYear: \"2025\",\n    cvn: \"123\", // Optional\n    cardholderFirstName: \"John\",\n    cardholderLastName: \"Doe\",\n    cardholderEmail: \"john@example.com\",\n    cardholderPhoneNumber: \"+1234567890\",\n    paymentSessionId: \"ps-1234567890\",\n    confirmSave: true, // Optional, default to false\n    billingInformation: BillingInformationDto( // Optional\n        firstName: \"Budi\",\n        lastName: \"Santoso\",\n        email: \"budi@example.co.id\",\n        phoneNumber: \"+6281234567890\",\n        streetLine1: \"Jl. Jend. Sudirman No.Kav 48A\",\n        streetLine2: \"\", // Optional\n        city: \"San Francisco\",\n        provinceState: \"CA\",\n        country: \"US\",\n        postalCode: \"94107\"\n    )\n)\n```\n\n### Collect CVN Only\n\nFor saved cards where you only need to collect the CVN:\n\n#### Android\n```kotlin\nval response = cardSessions.collectCvn(\n    cvn = \"123\",\n    paymentSessionId = \"ps-1234567890\"\n)\n```\n\n#### iOS\n```swift\nlet response = try await cardSessions.collectCvn(\n    cvn: \"123\",\n    paymentSessionId: \"ps-1234567890\"\n)\n```\n\n### Monitor Session State\n\n#### Android\n```kotlin\ncardSessions.state.collect { state -\u003e\n    when {\n        state.isLoading -\u003e // Show loading state\n        state.exception != null -\u003e // Handle exception\n        state.cardResponse != null -\u003e // Handle success\n    }\n}\n```\n\n#### iOS\n```swift\n// Using Combine\ncardSessions.state\n    .sink { state in\n        if state.isLoading {\n            // Show loading state\n        } else if let exception = state.exception {\n            // Handle exception\n        } else if let response = state.cardResponse {\n            // Handle success\n        }\n    }\n```\n\n## Response Types\n\n### Success Response\n```json\n{\n    \"message\": \"Status updated. Wait for callback\",\n    \"payment_token_id\": \"pt-1234567890\",\n    \"action_url\": \"https://redirect-gateway...\"\n}\n```\n\n### Error Response\n```json\n{\n    \"error_code\": \"ERROR_CODE\",\n    \"message\": \"Error message\"\n}\n```\n\n## Security\n\nThe SDK automatically handles:\n- Secure data transmission\n- Card data validation\n- 3DS authentication flow\n- Fingerprint generation\n\n## Requirements\n\n- Android API level 21 or higher\n- iOS 13.0 or higher\n- Swift 5.5 or higher\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxendit%2Fcards-session-mobile-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxendit%2Fcards-session-mobile-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxendit%2Fcards-session-mobile-sdk/lists"}