-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Migrated Saved Card Module to KMP (#1800)
- Loading branch information
Showing
73 changed files
with
4,222 additions
and
1,124 deletions.
There are no files selected for viewing
This file contains 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
39 changes: 0 additions & 39 deletions
39
core/common/src/commonMain/kotlin/org/mifospay/core/common/CreditCardUtils.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
45 changes: 45 additions & 0 deletions
45
core/model/src/commonMain/kotlin/org/mifospay/core/model/savedcards/SavedCard.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2024 Mifos Initiative | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md | ||
*/ | ||
package org.mifospay.core.model.savedcards | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import org.mifospay.core.common.IgnoredOnParcel | ||
import org.mifospay.core.common.Parcelable | ||
import org.mifospay.core.common.Parcelize | ||
|
||
@Serializable | ||
@Parcelize | ||
data class SavedCard( | ||
val id: Long = 0, | ||
@SerialName("client_id") | ||
val clientId: Long, | ||
val firstName: String, | ||
val lastName: String, | ||
val cardNumber: String, | ||
val cvv: String, | ||
val expiryDate: String, | ||
val backgroundColor: String, | ||
@SerialName("created_at") | ||
val createdAt: List<Long>, | ||
@SerialName("updated_at") | ||
val updatedAt: List<Long>, | ||
) : Parcelable { | ||
@IgnoredOnParcel | ||
val fullName = "$firstName $lastName" | ||
|
||
@IgnoredOnParcel | ||
val formattedExpiryDate: String | ||
get() = "${expiryDate.substring(0, 2)}/${expiryDate.substring(2, 4)}" | ||
|
||
@IgnoredOnParcel | ||
val maskedCvv: String | ||
get() = "*".repeat(cvv.length) | ||
} |
This file contains 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
Oops, something went wrong.