-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: wire make payment with send payment
- Loading branch information
1 parent
a86d8e2
commit 0a35938
Showing
9 changed files
with
107 additions
and
19 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
mifospay/src/main/java/org/mifospay/common/navigation/MakeTransferNavigation.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,51 @@ | ||
package org.mifospay.common.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavOptions | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import org.mifospay.common.ui.MakeTransferScreenRoute | ||
import org.mifospay.payments.send.navigation.PAYEE_EXTERNAL_ID_ARG | ||
import org.mifospay.payments.send.navigation.TRANSFER_AMOUNT_ARG | ||
|
||
const val MAKE_TRANSFER_ROUTE_BASE = "make_transfer_route" | ||
const val MAKE_TRANSFER_ROUTE = MAKE_TRANSFER_ROUTE_BASE + | ||
"?${PAYEE_EXTERNAL_ID_ARG}={$PAYEE_EXTERNAL_ID_ARG}" + | ||
"&${TRANSFER_AMOUNT_ARG}={$TRANSFER_AMOUNT_ARG}" | ||
|
||
fun NavController.navigateToMakeTransferScreen( | ||
externalId: String? = null, | ||
transferAmount: String? = null, | ||
navOptions: NavOptions? = null | ||
) { | ||
val route = MAKE_TRANSFER_ROUTE_BASE + if (transferAmount != null) { | ||
"?${PAYEE_EXTERNAL_ID_ARG}=$externalId" + | ||
"&${TRANSFER_AMOUNT_ARG}=$transferAmount" | ||
} else { | ||
"?${PAYEE_EXTERNAL_ID_ARG}=$externalId" + | ||
"&${TRANSFER_AMOUNT_ARG}=${"0.0"}" | ||
} | ||
navigate(route, navOptions) | ||
} | ||
|
||
fun NavGraphBuilder.makeTransferScreen() { | ||
composable( | ||
route = MAKE_TRANSFER_ROUTE, | ||
arguments = listOf( | ||
navArgument(PAYEE_EXTERNAL_ID_ARG) { | ||
type = NavType.StringType | ||
defaultValue = null | ||
nullable = true | ||
}, | ||
navArgument(TRANSFER_AMOUNT_ARG) { | ||
type = NavType.StringType | ||
defaultValue = null | ||
nullable = true | ||
} | ||
) | ||
) { | ||
MakeTransferScreenRoute() | ||
} | ||
} |
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
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