Repository navigation
Release v1.0.0 — Openpay Android SDK rebuilt on Kotlin and Compose - #22
Merged
Merged
Conversation
- Add :openpay-sdk Android library module (Compose-enabled, minSdk 26, AGP 9 built-in Kotlin, kotlinx.serialization plugin) - Expand libs.versions.toml with Kotlin, Compose BOM, Koin, Ktor, kotlinx libraries, Mockito, Robolectric and JaCoCo versions - Add shared JaCoCo convention in the root build: per-module jacocoTestReport and jacocoCoverageVerification (80% line minimum) - Convert :app to Kotlin + Compose with a placeholder screen consuming the SDK, Material 3 theme and edge-to-edge activity - Pin androidx.core to 1.17.0 (1.19.0 requires compileSdk 37 / AGP 9.1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Domain models: Card (with API-formatted expiration), Address, Token, TokenizedCard as immutable data classes - OpenpayConfig + OpenpayCountry (MX/CO/PE) + OpenpayEnvironment resolve the API base URL, matching the legacy SDK endpoints - OpenpayException sealed hierarchy: ServiceError (API error body) and ConnectionError (transport failures) - Ktor HttpClient factory (CIO engine): Basic auth with public key, SDK user agent, JSON content negotiation, 60s timeouts - OpenpayResponseHandler maps non-2xx responses to ServiceError parsing the documented Openpay error body - Serialization DTOs + mappers between DTOs and domain models - Isolated Koin container (OpenpayKoinContext) so the SDK graph never clashes with a host app using Koin Tests: 23 new unit tests, module line coverage 95.9% Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- CardBrand detection from IIN prefixes: Visa, Mastercard (51-55 and 2221-2720 series), American Express, with per-brand CVV length - CardValidator: Luhn check with separator tolerance, holder name rules supporting accented names, brand-aware security code validation and clock-injectable expiration validation (current month .. +20 years) - CardValidationResult reports every invalid field so UIs can point errors to the exact input Tests: 27 new unit tests with a frozen clock, module coverage 95.7% Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- TokenRepository domain interface + RemoteTokenRepository posting to
v1/{merchantId}/tokens, wrapping transport failures as ConnectionError
- CreateTokenUseCase validates the card locally (ValidationError with
the failing fields) before any network call
- OpenpayException.ValidationError added to the sealed hierarchy
- Public Openpay facade: OpenpayConfig constructor plus legacy-style
(merchantId, publicApiKey, productionMode, country) constructor,
suspend Result<Token> API and main-thread OpenpayCallback API,
shutdown() releasing the coroutine scope and Koin graph
- Koin data module wiring repository, use case and clock
Tests: 9 new unit tests (MockEngine repository, Mockito use case,
test-dispatcher facade), module coverage 87.4%
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- DeviceSessionIdGenerator: 32 character hexadecimal session ids
- WebViewDeviceSessionCollector: loads {baseUrl}/oa/logo.htm?m={merchant}
&s={session} in a short-lived hidden WebView (JS enabled, destroyed on
page finish), replicating the legacy fingerprint collection
- Injectable WebView factory so Robolectric tests can observe the loaded
URL and settings
- Openpay.setupDeviceSession(activity) exposes the flow, resolved through
the new antifraud Koin module
Tests: 7 new tests (Robolectric shadows + Mockito facade delegation),
module coverage 85.3%
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- OpenpayTheme: Material 3 light/dark schemes with Openpay palette - Field components: holder name, card number (live brand badge + grouped formatting), MM/YY expiration, masked security code - Visual transformations with exact offset mappings (4-4-4-4 and Amex 4-6-5 grouping, MM/YY separator) - OpenpayCardFormState: digits-only filtering, brand-aware CVV length, per-field error clearing, deliberate non-persistence of card data - OpenpayCardForm assembling the fields with validation on submit - Accessibility: labels + supporting error texts through semantics, content descriptions for brand badge and masked code, 48dp minimum touch target on submit - OpenpayCardFormView (AbstractComposeView) for XML-based host apps Tests: 24 new tests (offset-mapping round trips, state rules, Robolectric Compose interaction tests), module coverage 88.7% Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- SDK strings translated to es, pt and fr (values-es, values-pt, values-fr); English stays the default and the fallback for unbundled device languages - OpenpayLanguage enum with BCP-47 tag resolution (es-MX -> SPANISH) - OpenpayLocale.override: observable Compose state forcing a bundled language; null keeps automatic device-locale resolution - OpenpayLocale.localize(context) for view-based apps - OpenpayLocalized wrapper applied to every SDK composable so overrides recompose live; submit button text became nullable to localize its default inside the wrapped scope Tests: 14 new tests (per-locale resources via Robolectric qualifiers, override precedence, live recomposition on override change) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- CheckoutScreen: merchant configuration (id, key, country chips, production switch), SDK language selector (auto/en/es/pt/fr), antifraud device session button and the OpenpayCardForm, with token and error result display - CheckoutViewModel: state-flow driven, reuses the Openpay instance while the configuration is unchanged and rebuilds it (with shutdown) when it changes; readable error descriptions per failure type - Koin at app level: SampleApplication starts Koin (guarded for test runners) and the view model is injected with koinViewModel() - Removed the scaffold placeholder test Tests: 10 new tests (view model with mocked SDK + Robolectric Compose screen tests) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- maven-publish with the release AAR variant plus sources and javadoc jars - Coordinates mx.dev1.openpay:openpay-sdk:1.0.0 from gradle.properties (GROUP / VERSION_NAME kept aligned with OpenpaySdk.VERSION) - Full POM metadata: name, description, Apache 2.0 license, developers and scm pointing at the repository - Optional remote repository and in-memory PGP signing configured purely through environment variables, so credentials never live in the build; publishToMavenLocal works with no setup Verified with ./gradlew :openpay-sdk:publishToMavenLocal Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Root README.md: features, installation, quick start, documentation
matrix linking every guide in the four languages
- docs/{en,es,fr,pt}/ each with five guides written for readers without
Android experience:
- getting-started: requirements, install, configure, tokenize, device
session, error handling, sandbox test cards
- architecture: clean architecture layers, module/layer diagrams and
tokenization + antifraud sequence diagrams (Mermaid)
- ui-components: Compose form, standalone fields, XML interop and the
accessibility guarantees
- internationalization: automatic resolution, override API, flow
diagram, how to add a language
- contributing: machine setup, everyday Gradle commands, project rules,
Git Flow diagram and PR checklist
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat: multi-module project structure with openpay-sdk library
The checkout column scrolls, but the keyboard overlapped it: the activity window was not resizing on IME and the scrollable viewport ignored the IME inset, so focused fields near the bottom stayed covered. - MainActivity now uses windowSoftInputMode=adjustResize so the window reports IME insets under edge-to-edge - The checkout column adds Modifier.imePadding() before verticalScroll, shrinking the scroll viewport above the keyboard so the focused field can always scroll into view Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…verlap fix: checkout content hidden behind the keyboard
IDE state is machine-specific and was generating noise in diffs. The whole /.idea/ folder is now ignored (replacing the previous per-file entries) and its tracked files are removed from the index; local copies stay untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chore: remove the .idea folder from version control
Adds OpenpayCardPreview, a Compose card visual that mirrors the form in real time (masked number, holder name, expiration and detected brand). OpenpayCardForm now renders it above the fields by default, with a showCardPreview flag so host apps that draw their own card artwork can opt out. The preview hides its inner texts from screen readers and never announces card digits, exposing a single localized description instead. Strings localized in English, Spanish, Portuguese and French. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every SDK and sample composable now has @Preview functions, kept in dedicated *Previews.kt files so the tightened JaCoCo exclusion (*PreviewsKt*) no longer hides real components like OpenpayCardPreview from coverage. The sample app splits the card form out of the merchant configuration: CheckoutScreen keeps configuration, language and device session plus an Add card button gated on complete credentials, and the new AddCardScreen hosts the SDK form with navigation-compose wiring and a shared activity-scoped view model. Screens are refactored into stateless *Content composables so previews and tests render them with fabricated states. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat: live card preview in the standardized card form
…screen feat: previews for every composable and an independent add-card screen
feat: land composable previews and the independent add-card screen in develop
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ci: GitHub Actions pipeline with tests and PR coverage comments
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat: issuer logo and brand colors on the card preview and token output
…tion docs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat: land the brand visuals tweaks in develop
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chore: Apache 2.0 LICENSE file
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ci: CD pipeline that publishes releases to Maven Central
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release summary
First production release of the rebuilt Openpay Android SDK: a Kotlin 2.2 / Compose-first library published as
mx.dev1.openpay:openpay-sdk:1.0.0, plus a sample app demonstrating the full flow. Everything below was merged intodevelopthrough reviewed PRs (#1–#21).SDK (
openpay-sdk)Openpayfacade:createToken(card)returns a KotlinResult<Token>; merchant id/public key configuration with sandbox and production modes for MX / CO / PE.CardBrand.fromBrandNamemaps API brand strings.setupDeviceSession).OpenpayCardForm, individually composable fields, and a liveOpenpayCardPreviewwith issuer identity: Visa navy→yellow gradient (70% navy), Mastercard orange→yellow gradient, Amex solid blue, issuer logo on the card; publicOpenpayCardBrandLogobadge for outputs. XML interop viaOpenpayCardFormViewfor View-based apps.OpenpayLocale.override).Sample app (
app)Checkout configuration screen plus an independent add-card screen consuming the SDK form, with navigation-compose and Koin wiring; the token result shows the masked card with the brand logo.
Quality and automation
openpay-sdk— currently at ~83% overall.ci.yml): tests, coverage gate and an auto-updating coverage comment on every PR; instrumented tests on an API 34 emulator.cd.yml): pushing av*tag runs tests, verifies the tag matchesVERSION_NAME, signs and uploads to the Sonatype Central Portal, and creates the GitHub release; publication to Maven Central stays behind a manual Publish confirmation in the portal.Documentation and licensing
docs/(getting started, architecture with diagrams, UI components with native-form and custom-inputs implementation instructions, i18n, contributing, CI/CD).LICENSE.md), matching the license declared in the published POM.After merging
git tag v1.0.0 master && git push origin v1.0.0— this triggers the CD pipeline.🤖 Generated with Claude Code