-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from xendit/add_ios_fingerprint_sdk
Add iOS FingerprintSDK
- Loading branch information
Showing
11 changed files
with
199 additions
and
27 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
androidApp/src/main/java/com/cards/session/android/CustomTextField.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,40 @@ | ||
package com.cards.session.android | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.OutlinedTextField | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun CustomTextField( | ||
label: String, | ||
placeholder: String = "", | ||
onValueChange: (String) -> Unit | ||
) { | ||
var text by remember { mutableStateOf("") } | ||
|
||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(16.dp) | ||
) { | ||
OutlinedTextField( | ||
value = text, | ||
onValueChange = { newValue -> | ||
text = newValue | ||
onValueChange(newValue) | ||
}, | ||
label = { Text(text = label) }, | ||
placeholder = { Text(text = placeholder) }, | ||
modifier = Modifier.fillMaxWidth() | ||
) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -60,6 +60,7 @@ fun AppRoot() { | |
} | ||
val state by cardSessions.state.collectAsState() | ||
val scope = CoroutineScope(Dispatchers.Main) | ||
var paymentSessionId = "" | ||
|
||
NavHost( | ||
navController = navController, | ||
|
@@ -78,6 +79,19 @@ fun AppRoot() { | |
textAlign = TextAlign.Center, | ||
modifier = Modifier.fillMaxWidth() | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
|
||
CustomTextField( | ||
label = "Enter paymentSessionId", | ||
placeholder = "paymentSessionId", | ||
onValueChange = { newText -> | ||
// Handle text change here | ||
paymentSessionId = newText | ||
println("New text: $newText") | ||
} | ||
) | ||
|
||
Spacer(modifier = Modifier.height(16.dp)) | ||
Button( | ||
content = { Text(text = "Collect Card Data") }, | ||
|
@@ -91,8 +105,8 @@ fun AppRoot() { | |
cardholderFirstName = "First", | ||
cardholderLastName = "Name", | ||
cardholderEmail = "[email protected]", | ||
cardholderPhoneNumber = "01231245242", | ||
paymentSessionId = "ps-1234567890abcdef12345678" | ||
cardholderPhoneNumber = "+123456789", | ||
paymentSessionId = paymentSessionId | ||
) | ||
} | ||
} | ||
|
@@ -104,7 +118,7 @@ fun AppRoot() { | |
scope.launch { | ||
cardSessions.collectCvn( | ||
cvn = "123", | ||
paymentSessionId = "ps-1234567890abcdef12345678" | ||
paymentSessionId = paymentSessionId | ||
) | ||
} | ||
} | ||
|
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
Oops, something went wrong.